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>
_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
# 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