xfs: fix $XFS_DB_PROG usage

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.  Fix that by adding a new _scratch_xfs_db helper.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Darrick J. Wong
2016-09-29 19:23:41 -07:00
committed by Eryu Guan
parent fff869cb9c
commit c08ebd092d
37 changed files with 137 additions and 137 deletions
+8 -3
View File
@@ -1106,6 +1106,11 @@ _scratch_xfs_db_options()
echo $SCRATCH_OPTIONS $* $SCRATCH_DEV
}
_scratch_xfs_db()
{
$XFS_DB_PROG "$@" $(_scratch_xfs_db_options)
}
_scratch_xfs_logprint()
{
SCRATCH_OPTIONS=""
@@ -2083,7 +2088,7 @@ _require_xfs_db_command()
fi
command=$1
$XFS_DB_PROG -x -c "help" $SCRATCH_DEV | grep $command > /dev/null || \
_scratch_xfs_db -x -c "help" | grep $command > /dev/null || \
_notrun "xfs_db $command support is missing"
}
@@ -3367,11 +3372,11 @@ _require_meta_uuid()
# This will create a crc fs on $SCRATCH_DEV
_require_xfs_crc
$XFS_DB_PROG -x -c "uuid restore" $SCRATCH_DEV 2>&1 \
_scratch_xfs_db -x -c "uuid restore" 2>&1 \
| grep -q "invalid UUID\|supported on V5 fs" \
&& _notrun "Userspace doesn't support meta_uuid feature"
$XFS_DB_PROG -x -c "uuid generate" $SCRATCH_DEV >/dev/null 2>&1
_scratch_xfs_db -x -c "uuid generate" >/dev/null 2>&1
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Kernel doesn't support meta_uuid feature"