xfs: wrap xfs_db calls to the test device

Create a _test_xfs_db analogue to _scratch_xfs_db so that we can
encapsulate whatever strange test fs options were fed to us by the test
runner.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Darrick J. Wong
2020-09-14 18:43:34 -07:00
committed by Eryu Guan
parent 5f98984ec7
commit 66dd0c19da
4 changed files with 23 additions and 10 deletions
+2 -2
View File
@@ -149,7 +149,7 @@ _log_sunit()
_after_log()
{
xfs_db -r $1 -c "sb" -c "print" | $AWK_PROG '
_scratch_xfs_db -r -c "sb" -c "print" | $AWK_PROG '
/logstart/ { logstart = $3 }
/logblocks/ { logblocks = $3 }
END {
@@ -163,7 +163,7 @@ _check_corrupt()
f="c6c6c6c6"
echo "*** check for corruption"
echo "expect $f..." >>$seqres.full
xfs_db -r -c "fsblock $2" -c "print" $1 | head | tee -a $seqres.full | \
_scratch_xfs_db -r -c "fsblock $2" -c "print" | head | tee -a $seqres.full | \
grep -q -v "$f $f $f $f $f $f $f $f" && \
_fail "!!! block $2 corrupted!"
}