diff mbox series

[2/3] xfs/291: convert open-coded _scratch_xfs_repair usage

Message ID 165950049164.198815.17444582280704119144.stgit@magnolia (mailing list archive)
State New, archived
Headers show
Series fstests: random fixes for v2022.07.31 | expand

Commit Message

Darrick J. Wong Aug. 3, 2022, 4:21 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Convert this test to use _scratch_xfs_repair, since the only variance
from the standard usage is that it's called against a sparse file into
which the scratch filesystem has been metadumped and mdrestored.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/xfs/291 |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Zorro Lang Aug. 4, 2022, 3:57 p.m. UTC | #1
On Tue, Aug 02, 2022 at 09:21:31PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Convert this test to use _scratch_xfs_repair, since the only variance
> from the standard usage is that it's called against a sparse file into
> which the scratch filesystem has been metadumped and mdrestored.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  tests/xfs/291 |    6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> 
> diff --git a/tests/xfs/291 b/tests/xfs/291
> index 6d5e247e..a2425e47 100755
> --- a/tests/xfs/291
> +++ b/tests/xfs/291
> @@ -93,11 +93,7 @@ _scratch_xfs_check >> $seqres.full 2>&1 || _fail "xfs_check failed"
>  # Can xfs_metadump cope with this monster?
>  _scratch_xfs_metadump $tmp.metadump || _fail "xfs_metadump failed"
>  xfs_mdrestore $tmp.metadump $tmp.img || _fail "xfs_mdrestore failed"
> -[ "$USE_EXTERNAL" = yes ] && [ -n "$SCRATCH_RTDEV" ] && \
> -	rt_repair_opts="-r $SCRATCH_RTDEV"
> -[ "$USE_EXTERNAL" = yes ] && [ -n "$SCRATCH_LOGDEV" ] && \
> -	log_repair_opts="-l $SCRATCH_LOGDEV"
> -$XFS_REPAIR_PROG $rt_repair_opts $log_repair_opts -f $tmp.img >> $seqres.full 2>&1 || \
> +SCRATCH_DEV=$tmp.img _scratch_xfs_repair -f &>> $seqres.full || \

Good to me,

Reviewed-by: Zorro Lang <zlang@redhat.com>

Feel free to reply, if anyone has objection.

>  	_fail "xfs_repair of metadump failed"
>  
>  # Yes it can; success, all done
>
diff mbox series

Patch

diff --git a/tests/xfs/291 b/tests/xfs/291
index 6d5e247e..a2425e47 100755
--- a/tests/xfs/291
+++ b/tests/xfs/291
@@ -93,11 +93,7 @@  _scratch_xfs_check >> $seqres.full 2>&1 || _fail "xfs_check failed"
 # Can xfs_metadump cope with this monster?
 _scratch_xfs_metadump $tmp.metadump || _fail "xfs_metadump failed"
 xfs_mdrestore $tmp.metadump $tmp.img || _fail "xfs_mdrestore failed"
-[ "$USE_EXTERNAL" = yes ] && [ -n "$SCRATCH_RTDEV" ] && \
-	rt_repair_opts="-r $SCRATCH_RTDEV"
-[ "$USE_EXTERNAL" = yes ] && [ -n "$SCRATCH_LOGDEV" ] && \
-	log_repair_opts="-l $SCRATCH_LOGDEV"
-$XFS_REPAIR_PROG $rt_repair_opts $log_repair_opts -f $tmp.img >> $seqres.full 2>&1 || \
+SCRATCH_DEV=$tmp.img _scratch_xfs_repair -f &>> $seqres.full || \
 	_fail "xfs_repair of metadump failed"
 
 # Yes it can; success, all done