From afd025f43685f83b474599b9cb3944db71a15f0b Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Wed, 1 Apr 2015 11:26:40 +1100 Subject: [PATCH] xfs/078: remove loop device on failure If the test fails for any reason, it fails to tear down the loop device that was set up and hence the test device cannot be unmounted, causing failures of subsequent tests. Signed-off-by: Dave Chinner Signed-off-by: Dave Chinner --- tests/xfs/078 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/xfs/078 b/tests/xfs/078 index d8cb9196..32436f7e 100755 --- a/tests/xfs/078 +++ b/tests/xfs/078 @@ -37,6 +37,7 @@ _cleanup() cd / rm -f $tmp.* umount $LOOP_MNT 2>/dev/null + [ -n "$LOOP_DEV" ] && losetup -d $LOOP_DEV rmdir $LOOP_MNT } @@ -62,6 +63,8 @@ _filter_io() # real QA test starts here +rm -f $seqres.full + echo "*** create loop mount point" rmdir $LOOP_MNT 2>/dev/null mkdir -p $LOOP_MNT || _fail "cannot create loopback mount point" @@ -84,7 +87,7 @@ _grow_loop() echo echo "*** mkfs loop file (size=$original)" - $MKFS_XFS_PROG -b size=$bsize -d $dparam \ + $MKFS_XFS_PROG -m crc=0 -b size=$bsize -d $dparam \ | _filter_mkfs 2>/dev/null echo "*** extend loop file" @@ -107,6 +110,7 @@ _grow_loop() losetup $LOOP_DEV $LOOP_IMG _check_xfs_filesystem $LOOP_DEV none none losetup -d $LOOP_DEV + LOOP_DEV= fi rm -f $LOOP_IMG -- 2.39.5