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 -8
View File
@@ -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
_scratch_xfs_db -x -c "inode $FILE_INO" -c "write $field 0"
num=1
for n in `seq 0 1 $bits`; do
$XFS_DB_PROG -x -c "inode $FILE_INO" \
-c "write $field $num" $SCRATCH_DEV
_scratch_xfs_db -x -c "inode $FILE_INO" \
-c "write $field $num"
let num=$num*2
done
echo
@@ -89,10 +89,10 @@ _do_bit_test "u.bmx[0].startoff" $BMBT_STARTOFF_BITLEN
_do_bit_test "u.bmx[0].startblock" $BMBT_STARTBLOCK_BITLEN
_do_bit_test "u.bmx[0].blockcount" $BMBT_BLOCKCOUNT_BITLEN
# test setting the 32 bit generation number
$XFS_DB_PROG -x -c "inode $FILE_INO" -c "write core.gen 0x5a" $SCRATCH_DEV
$XFS_DB_PROG -x -c "inode $FILE_INO" -c "write core.gen 0xa5" $SCRATCH_DEV
$XFS_DB_PROG -x -c "inode $FILE_INO" -c "write core.gen 0" $SCRATCH_DEV
$XFS_DB_PROG -x -c "inode $FILE_INO" -c "write core.gen #5a5a" $SCRATCH_DEV
$XFS_DB_PROG -x -c "inode $FILE_INO" -c "write core.gen #a5a5" $SCRATCH_DEV
_scratch_xfs_db -x -c "inode $FILE_INO" -c "write core.gen 0x5a"
_scratch_xfs_db -x -c "inode $FILE_INO" -c "write core.gen 0xa5"
_scratch_xfs_db -x -c "inode $FILE_INO" -c "write core.gen 0"
_scratch_xfs_db -x -c "inode $FILE_INO" -c "write core.gen #5a5a"
_scratch_xfs_db -x -c "inode $FILE_INO" -c "write core.gen #a5a5"
status=0
exit