aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Wareing <rwareing@fb.com>2018-01-11 20:16:19 -0800
committerEryu Guan <eguan@redhat.com>2018-01-19 12:47:15 +0800
commit21e739820378bccbbb01305f8b59e64d9cd5a52f (patch)
treededeef591d8f14774d89a6258e650ebde6484b5c
parentee3e00103527fbd0d2eeedd2a8e40f8d36d10c4a (diff)
downloadxfstests-dev-21e739820378bccbbb01305f8b59e64d9cd5a52f.tar.gz
xfs/realtime: Fix direct invocations of xfs_repair
Fixes direct invocations of xfs_repair to add in -r option if required. Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Richard Wareing <rwareing@fb.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
-rwxr-xr-xtests/xfs/0705
-rwxr-xr-xtests/xfs/2915
2 files changed, 8 insertions, 2 deletions
diff --git a/tests/xfs/070 b/tests/xfs/070
index 0ae6effa55..81111d5d0b 100755
--- a/tests/xfs/070
+++ b/tests/xfs/070
@@ -56,7 +56,10 @@ _cleanup()
_xfs_repair_noscan()
{
# invoke repair directly so we can kill the process if need be
- $XFS_REPAIR_PROG $SCRATCH_DEV 2>&1 | tee -a $seqres.full > $tmp.repair &
+ [ "$USE_EXTERNAL" = yes ] && [ -n "$SCRATCH_RTDEV" ] && \
+ rt_repair_opts="-r $SCRATCH_RTDEV"
+ $XFS_REPAIR_PROG $rt_repair_opts $SCRATCH_DEV 2>&1 |
+ tee -a $seqres.full > $tmp.repair &
repair_pid=$!
# monitor progress for as long as it is running
diff --git a/tests/xfs/291 b/tests/xfs/291
index 3f5295c554..fd5c1f1c26 100755
--- a/tests/xfs/291
+++ b/tests/xfs/291
@@ -122,7 +122,10 @@ _xfs_check $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_check failed"
# Can xfs_metadump cope with this monster?
_scratch_metadump $tmp.metadump || _fail "xfs_metadump failed"
xfs_mdrestore $tmp.metadump $tmp.img || _fail "xfs_mdrestore failed"
-xfs_repair -f $tmp.img >> $seqres.full 2>&1 || _fail "xfs_repair of metadump failed"
+[ "$USE_EXTERNAL" = yes ] && [ -n "$SCRATCH_RTDEV" ] && \
+ rt_repair_opts="-r $SCRATCH_RTDEV"
+$XFS_REPAIR_PROG $rt_repair_opts -f $tmp.img >> $seqres.full 2>&1 || \
+ _fail "xfs_repair of metadump failed"
# Yes it can; success, all done
status=0