xfs
[Top] [All Lists]

Re: [PATCH 06/13] xfs: fix $XFS_DB_PROG usage

To: "Darrick J. Wong" <darrick.wong@xxxxxxxxxx>
Subject: Re: [PATCH 06/13] xfs: fix $XFS_DB_PROG usage
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 2 Sep 2016 07:34:00 +1000
Cc: eguan@xxxxxxxxxx, linux-xfs@xxxxxxxxxxxxxxx, fstests@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <147216773738.32641.691363173215857168.stgit@xxxxxxxxxxxxxxxx>
References: <147216769914.32641.55434969009554013.stgit@xxxxxxxxxxxxxxxx> <147216773738.32641.691363173215857168.stgit@xxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Thu, Aug 25, 2016 at 04:28:57PM -0700, Darrick J. Wong wrote:
> xfs_db requires us to pass in the log device, if any; this can be
> accomplished via _scratch_xfs_db_options (if we're operating on the
> scratch device, anyway).  However, many of the tests/xfs/ scripts
> pass only $SCRATCH_DEV directly, so they'll fail if we test with an
> external log.  So, fix that.

I hadn't looked at this until now, but....

> diff --git a/tests/xfs/001 b/tests/xfs/001
> index c33adae..e1e1411 100755
> --- a/tests/xfs/001
> +++ b/tests/xfs/001
> @@ -44,11 +44,11 @@ _do_bit_test()
>       bits="$2"
>  
>       echo "testing $field with $bits bits"
> -     $XFS_DB_PROG -x -c "inode $FILE_INO" -c "write $field 0" $SCRATCH_DEV
> +     $XFS_DB_PROG -x -c "inode $FILE_INO" -c "write $field 0" 
> `_scratch_xfs_db_options`

*yuck*

We are going to be getting that wrong -all the time-.

I'd suggest changing these to

        _scratch_xfs_db <command string>

and

_scratch_xfs_db()
{
        $XFS_DB_PROG $* `_scratch_xfs_db_options`
}

And hiding everything to do with devices completely i a much cleaner
and more maintainable solution to the problem.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>