]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs: fix blocktrash fuzzers
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 1 May 2018 15:40:17 +0000 (08:40 -0700)
committerEryu Guan <guaneryu@gmail.com>
Wed, 2 May 2018 08:56:19 +0000 (16:56 +0800)
The blocktrash fuzz tests for xfs will try to mount and write to the
filesystem after corrupting it.  However, the mount may not necessarily
succeed, in which case we must not write junk to the root filesystem.
Use the new _try_scratch_mount to guard against that.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
22 files changed:
tests/xfs/086
tests/xfs/087
tests/xfs/088
tests/xfs/089
tests/xfs/091
tests/xfs/093
tests/xfs/097
tests/xfs/099
tests/xfs/100
tests/xfs/101
tests/xfs/102
tests/xfs/105
tests/xfs/112
tests/xfs/113
tests/xfs/117
tests/xfs/120
tests/xfs/123
tests/xfs/124
tests/xfs/125
tests/xfs/126
tests/xfs/235
tests/xfs/337

index 787f88650c60f96e2f374688f8ab59a41df37205..98b45dde00b3f9642e0df99d90c9aa8e32575c2d 100755 (executable)
@@ -93,13 +93,14 @@ done
 
 # Try to append to files; this should fail
 echo "+ mount image"
-_scratch_mount
-
-echo "+ modify files"
-for x in `seq 1 64`; do
-       $XFS_IO_PROG -f -c "pwrite -S 0x62 0 ${blksz}" "${TESTFILE}.${x}" >> $seqres.full
-done
-umount "${SCRATCH_MNT}"
+if _try_scratch_mount >> $seqres.full 2>&1; then
+
+       echo "+ modify files"
+       for x in `seq 1 64`; do
+               $XFS_IO_PROG -f -c "pwrite -S 0x62 0 ${blksz}" "${TESTFILE}.${x}" >> $seqres.full
+       done
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index 58ba9586cad630c4e3d859bafd71e96a1a922c1e..65877c7c4ed2330962c3f9c1e1349e1d21a73d70 100755 (executable)
@@ -91,15 +91,16 @@ for ag in $(seq 1 $((agcount - 1))) 0; do
 done
 
 echo "+ mount image"
-_scratch_mount
-
-echo "+ modify files"
-broken=0
-for x in `seq 65 70`; do
-       touch "${TESTFILE}.${x}" 2> /dev/null || broken=1
-done
-echo "broken: ${broken}"
-umount "${SCRATCH_MNT}"
+if _try_scratch_mount >> $seqres.full 2>&1; then
+
+       echo "+ modify files"
+       broken=0
+       for x in `seq 65 70`; do
+               touch "${TESTFILE}.${x}" 2> /dev/null || broken=1
+       done
+       echo "broken: ${broken}"
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index 36745b2ff52fe9039896f773d6f1fb8cffcc2f07..14b1f115b7c933458bc3359efd59844171ee9be0 100755 (executable)
@@ -92,13 +92,14 @@ done
 
 # Try to append to files; this should fail
 echo "+ mount image"
-_scratch_mount
-
-echo "+ modify files"
-for x in `seq 1 64`; do
-       $XFS_IO_PROG -f -c "pwrite -S 0x62 0 ${blksz}" "${TESTFILE}.${x}" >> $seqres.full
-done
-umount "${SCRATCH_MNT}"
+if _try_scratch_mount >> $seqres.full 2>&1; then
+
+       echo "+ modify files"
+       for x in `seq 1 64`; do
+               $XFS_IO_PROG -f -c "pwrite -S 0x62 0 ${blksz}" "${TESTFILE}.${x}" >> $seqres.full
+       done
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index 52bdd542957ef8460753d9dc8d243e5ee588ce29..e47f7fefc77a026f332fee5e5a12a2c0fb3db658 100755 (executable)
@@ -92,13 +92,14 @@ done
 
 # Try to append to files; this should fail
 echo "+ mount image"
-_scratch_mount
-
-echo "+ modify files"
-for x in `seq 1 64`; do
-       $XFS_IO_PROG -f -c "pwrite -S 0x62 0 ${blksz}" "${TESTFILE}.${x}" >> $seqres.full
-done
-umount "${SCRATCH_MNT}"
+if _try_scratch_mount >> $seqres.full 2>&1; then
+
+       echo "+ modify files"
+       for x in `seq 1 64`; do
+               $XFS_IO_PROG -f -c "pwrite -S 0x62 0 ${blksz}" "${TESTFILE}.${x}" >> $seqres.full
+       done
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index ae6233707b8589d76486c34e4a20cc4a25603473..7adbdc9efb4264b2e94c07bef130bdf99f2b7eb4 100755 (executable)
@@ -92,13 +92,14 @@ done
 
 # Try to append to files; this should fail
 echo "+ mount image"
-_scratch_mount
-
-echo "+ modify files"
-for x in `seq 1 64`; do
-       $XFS_IO_PROG -f -c "pwrite -S 0x62 0 ${blksz}" "${TESTFILE}.${x}" >> $seqres.full
-done
-umount "${SCRATCH_MNT}"
+if _try_scratch_mount >> $seqres.full 2>&1; then
+
+       echo "+ modify files"
+       for x in `seq 1 64`; do
+               $XFS_IO_PROG -f -c "pwrite -S 0x62 0 ${blksz}" "${TESTFILE}.${x}" >> $seqres.full
+       done
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index 0f9311e9bcb537b6e94a61ae2fddd606c344f867..440cdb6602d4ec0617d51922c0451cdec9dc4f6c 100755 (executable)
@@ -91,15 +91,16 @@ for ag in $(seq 1 $((agcount - 1))) 0; do
 done
 
 echo "+ mount image"
-_scratch_mount
-
-echo "+ modify files"
-broken=0
-for x in `seq 65 70`; do
-       touch "${TESTFILE}.${x}" 2> /dev/null || broken=1
-done
-echo "broken: ${broken}"
-umount "${SCRATCH_MNT}"
+if _try_scratch_mount >> $seqres.full 2>&1; then
+
+       echo "+ modify files"
+       broken=0
+       for x in `seq 65 70`; do
+               touch "${TESTFILE}.${x}" 2> /dev/null || broken=1
+       done
+       echo "broken: ${broken}"
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index 303ad04ff0badd2dd9018b5a06afb389367c5734..703bd9b49036434a088f65e3dcca99dbb995cdee 100755 (executable)
@@ -94,15 +94,16 @@ for ag in $(seq 1 $((agcount - 1))) 0; do
 done
 
 echo "+ mount image"
-_scratch_mount
-
-echo "+ modify files"
-broken=0
-for x in `seq 65 70`; do
-       touch "${TESTFILE}.${x}" 2> /dev/null || broken=1
-done
-echo "broken: ${broken}"
-umount "${SCRATCH_MNT}"
+if _try_scratch_mount >> $seqres.full 2>&1; then
+
+       echo "+ modify files"
+       broken=0
+       for x in `seq 65 70`; do
+               touch "${TESTFILE}.${x}" 2> /dev/null || broken=1
+       done
+       echo "broken: ${broken}"
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index 7835df9f110ab66f4a477d7e6486d53bd4fbe031..2d63536c540061f00bcbb2ec351ba7a4013d36c0 100755 (executable)
@@ -82,12 +82,13 @@ echo "+ corrupt dir"
 _scratch_xfs_db -x -c "inode ${inode}" -c 'dblock 0' -c "stack" -c "blocktrash -x 32 -y $((blksz * 8)) -z ${FUZZ_ARGS}" >> $seqres.full
 
 echo "+ mount image"
-_scratch_mount
+if _try_scratch_mount >> $seqres.full 2>&1; then
 
-echo "+ modify dir"
-rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
-mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
-umount "${SCRATCH_MNT}"
+       echo "+ modify dir"
+       rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
+       mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index ebb656d3b6084b66f73fdd9237946d0c3a31f137..83146ee07ca2539c451ddfd01ba6159a73bdc4f5 100755 (executable)
@@ -87,12 +87,13 @@ while true; do
 done
 
 echo "+ mount image"
-_scratch_mount
+if _try_scratch_mount >> $seqres.full 2>&1; then
 
-echo "+ modify dir"
-rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
-mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
-umount "${SCRATCH_MNT}"
+       echo "+ modify dir"
+       rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
+       mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index 709fc9d327e816aa3f27cd40033aab8ba6e16f91..426c3e9ca3c7b865a46f95cf88e610928d6cf7a9 100755 (executable)
@@ -82,12 +82,13 @@ echo "+ corrupt dir"
 _scratch_xfs_db -x -c "inode ${inode}" -c "dblock ${leaf_lblk}" -c "stack" -c "blocktrash -x 32 -y $((blksz * 8)) -z ${FUZZ_ARGS}" >> $seqres.full
 
 echo "+ mount image"
-_scratch_mount
+if _try_scratch_mount >> $seqres.full 2>&1; then
 
-echo "+ modify dir"
-rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
-mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
-umount "${SCRATCH_MNT}"
+       echo "+ modify dir"
+       rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
+       mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index 3d51c6a25e50055ef116586b05e8ed438f396f16..02bc35ca01569658419c6029fe6b245e576144a4 100755 (executable)
@@ -87,12 +87,13 @@ while true; do
 done
 
 echo "+ mount image"
-_scratch_mount
+if _try_scratch_mount >> $seqres.full 2>&1; then
 
-echo "+ modify dir"
-rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
-mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
-umount "${SCRATCH_MNT}"
+       echo "+ modify dir"
+       rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
+       mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index fc91a4f5ddc86f76a4eed455848f6622f4362109..c3a853b003e5f97284bbc1c7d8c98b5025066a4e 100755 (executable)
@@ -87,12 +87,13 @@ while true; do
 done
 
 echo "+ mount image"
-_scratch_mount
+if _try_scratch_mount >> $seqres.full 2>&1; then
 
-echo "+ modify dir"
-rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
-mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
-umount "${SCRATCH_MNT}"
+       echo "+ modify dir"
+       rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
+       mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index ae756845d209229a2c8b8e2f899ee0f63eb0d999..cec3a168246e1e50ec63ae20736ef2bc5be63159 100755 (executable)
@@ -87,12 +87,13 @@ while true; do
 done
 
 echo "+ mount image"
-_scratch_mount
+if _try_scratch_mount >> $seqres.full 2>&1; then
 
-echo "+ modify dir"
-rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
-mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
-umount "${SCRATCH_MNT}"
+       echo "+ modify dir"
+       rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
+       mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index c347db78878234169af5d63ec3a647bf6b107b23..17af3b667bc5b461bd126df00fa74215f3c0e63e 100755 (executable)
@@ -87,12 +87,13 @@ while true; do
 done
 
 echo "+ mount image"
-_scratch_mount
+if _try_scratch_mount >> $seqres.full 2>&1; then
 
-echo "+ modify dir"
-rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
-mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
-umount "${SCRATCH_MNT}"
+       echo "+ modify dir"
+       rm -rf "${SCRATCH_MNT}/blockdir/00000000" 2> /dev/null && _fail "modified corrupt directory"
+       mkdir "${SCRATCH_MNT}/blockdir/xxxxxxxx" 2> /dev/null && _fail "add to corrupt directory"
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index f0b95aa14cf4b1cbfb0f56f6b13fabc13bdcd3e5..31eac295857a447d504a08dbfea6fdc513f50a6e 100755 (executable)
@@ -90,18 +90,19 @@ seq "${inode}" "$((inode + 64))" | while read ino; do
 done
 
 echo "+ mount image"
-_scratch_mount
-
-echo "+ modify files"
-broken=0
-for x in `seq 1 64`; do
-       stat "${TESTFILE}.${x}" >> $seqres.full 2>&1
-       test $? -ne 0 && broken=1
-       touch "${TESTFILE}.${x}" >> $seqres.full 2>&1
-       test $? -ne 0 && broken=1
-done
-echo "broken: ${broken}"
-umount "${SCRATCH_MNT}"
+if _try_scratch_mount >> $seqres.full 2>&1; then
+
+       echo "+ modify files"
+       broken=0
+       for x in `seq 1 64`; do
+               stat "${TESTFILE}.${x}" >> $seqres.full 2>&1
+               test $? -ne 0 && broken=1
+               touch "${TESTFILE}.${x}" >> $seqres.full 2>&1
+               test $? -ne 0 && broken=1
+       done
+       echo "broken: ${broken}"
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index 5a38000c73883ca46a54efd7614acafa630ba467..39c41d98f43c97c4332032dc8955e169d68af814 100755 (executable)
@@ -79,14 +79,15 @@ echo "+ corrupt image"
 _scratch_xfs_db -x -c "inode ${inode}" -c "addr u.bmbt.ptrs[1]" -c "addr u3.bmbt.ptrs[1]" -c "stack" -c "blocktrash -x 32 -y $((blksz * 8)) -z ${FUZZ_ARGS}" >> $seqres.full
 
 echo "+ mount image"
-_scratch_mount
-
-echo "+ modify files"
-before="$(stat -c '%b' "${SCRATCH_MNT}/bigfile")"
-$XFS_IO_PROG -f -c "pwrite -S 0x62 ${blksz} ${blksz}" -c 'fsync' "${SCRATCH_MNT}/bigfile" >> $seqres.full 2> /dev/null
-after="$(stat -c '%b' "${SCRATCH_MNT}/bigfile")"
-test "${before}" -eq "${after}" || _fail "pwrite should fail on corrupt bmbt"
-umount "${SCRATCH_MNT}"
+if _try_scratch_mount >> $seqres.full 2>&1; then
+
+       echo "+ modify files"
+       before="$(stat -c '%b' "${SCRATCH_MNT}/bigfile")"
+       $XFS_IO_PROG -f -c "pwrite -S 0x62 ${blksz} ${blksz}" -c 'fsync' "${SCRATCH_MNT}/bigfile" >> $seqres.full 2> /dev/null
+       after="$(stat -c '%b' "${SCRATCH_MNT}/bigfile")"
+       test "${before}" -eq "${after}" || _fail "pwrite should fail on corrupt bmbt"
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index 7355e86a4fc44a1d3d64b6fa6af8e18ecafb9ffe..2640d675a9a998e12afcc2c640af48dc6b87591a 100755 (executable)
@@ -78,9 +78,10 @@ echo "+ corrupt image"
 _scratch_xfs_db -x -c "inode ${inode}" -c "dblock 0" -c "stack" -c "blocktrash -x 32 -o 256 -y $((blksz * 8)) -z ${FUZZ_ARGS}" >> $seqres.full
 
 echo "+ mount image"
-_scratch_mount
-cat "${SCRATCH_MNT}/long_symlink" 2>/dev/null && _fail "symlink should be broken"
-umount "${SCRATCH_MNT}"
+if _try_scratch_mount >> $seqres.full 2>&1; then
+       cat "${SCRATCH_MNT}/long_symlink" 2>/dev/null && _fail "symlink should be broken"
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index a828dd6bb6a1c758046fef7a66db77f3d497fb68..742ef75a070d498e9a71ec26e7d03c25dc559d12 100755 (executable)
@@ -87,11 +87,12 @@ echo "+ corrupt xattr"
 _scratch_xfs_db -x -c "inode ${inode}" -c 'ablock 0' -c "stack" -c "blocktrash -x 32 -y $((blksz * 8)) -z ${FUZZ_ARGS}" >> $seqres.full
 
 echo "+ mount image"
-_scratch_mount
+if _try_scratch_mount >> $seqres.full 2>&1; then
 
-echo "+ modify xattr"
-setfattr -x "user.x00000000" "${SCRATCH_MNT}/attrfile" 2> /dev/null && _fail "modified corrupt xattr"
-umount "${SCRATCH_MNT}"
+       echo "+ modify xattr"
+       setfattr -x "user.x00000000" "${SCRATCH_MNT}/attrfile" 2> /dev/null && _fail "modified corrupt xattr"
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index 3afb4cc1d0d58de938b636935fcf9b1fd62bb7a2..4ab0177d560cc12ba8fdd7821b959049cd4ec0bb 100755 (executable)
@@ -87,11 +87,12 @@ echo "+ corrupt xattr"
 _scratch_xfs_db -x -c "inode ${inode}" -c 'ablock 0' -c "stack" -c "blocktrash -x 32 -o +32 -y $((blksz * 8)) -z ${FUZZ_ARGS}" >> $seqres.full
 
 echo "+ mount image"
-_scratch_mount
+if _try_scratch_mount >> $seqres.full 2>&1; then
 
-echo "+ modify xattr"
-setfattr -x "user.x00000000" "${SCRATCH_MNT}/attrfile" 2> /dev/null && _fail "modified corrupt xattr"
-umount "${SCRATCH_MNT}"
+       echo "+ modify xattr"
+       setfattr -x "user.x00000000" "${SCRATCH_MNT}/attrfile" 2> /dev/null && _fail "modified corrupt xattr"
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index d696ff1f50496ba992487296133b7557cac649ac..de6e2fdbcfcb978072bec1bdbc095d292ed21d74 100755 (executable)
@@ -92,11 +92,12 @@ while true; do
 done
 
 echo "+ mount image"
-_scratch_mount
+if _try_scratch_mount >> $seqres.full 2>&1; then
 
-echo "+ modify xattr"
-setfattr -x "user.x00000000" "${SCRATCH_MNT}/attrfile" 2> /dev/null && _fail "modified corrupt xattr"
-umount "${SCRATCH_MNT}"
+       echo "+ modify xattr"
+       setfattr -x "user.x00000000" "${SCRATCH_MNT}/attrfile" 2> /dev/null && _fail "modified corrupt xattr"
+       umount "${SCRATCH_MNT}"
+fi
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index 88101f2de8eec6268f28da15d42c82806d4660ca..84725b0af31444193ce0d28ff9d3e674c9d5dd8f 100755 (executable)
@@ -77,12 +77,13 @@ seq 0 $((agcount - 1)) | while read ag; do
 done
 
 echo "+ mount image"
-_scratch_mount
+if _try_scratch_mount >> $seqres.full 2>&1; then
 
-echo "+ copy more"
-$XFS_IO_PROG -f -c "pwrite -S 0x63 0 $((blksz * 64))" -c "fsync" ${SCRATCH_MNT}/file4 >> $seqres.full 2>&1
-test -s ${SCRATCH_MNT}/file4 && _fail "should not be able to copy with busted rmap btree"
-umount ${SCRATCH_MNT}
+       echo "+ copy more"
+       $XFS_IO_PROG -f -c "pwrite -S 0x63 0 $((blksz * 64))" -c "fsync" ${SCRATCH_MNT}/file4 >> $seqres.full 2>&1
+       test -s ${SCRATCH_MNT}/file4 && _fail "should not be able to copy with busted rmap btree"
+       umount ${SCRATCH_MNT}
+fi
 
 echo "+ repair fs"
 _disable_dmesg_check
index b61e7226d69470425b0c49cf35062db5ccda79ed..851b6439b4c3251a59c256e111c66ebef7f980b9 100755 (executable)
@@ -85,12 +85,13 @@ _scratch_xfs_db -x -c "sb" -c "addr rrmapino" -c "addr u3.rtrmapbt.ptrs[1]" \
        >> $seqres.full 2>&1
 
 echo "+ mount image"
-_scratch_mount
+if _try_scratch_mount >> $seqres.full 2>&1; then
 
-echo "+ copy more"
-$XFS_IO_PROG -f -R -c "pwrite -S 0x68 0 1" $SCRATCH_MNT/e3 >> $seqres.full 2>&1
-test -s ${SCRATCH_MNT}/f3 && echo "should not be able to copy with busted rtrmap btree"
-_scratch_unmount
+       echo "+ copy more"
+       $XFS_IO_PROG -f -R -c "pwrite -S 0x68 0 1" $SCRATCH_MNT/e3 >> $seqres.full 2>&1
+       test -s ${SCRATCH_MNT}/f3 && echo "should not be able to copy with busted rtrmap btree"
+       _scratch_unmount
+fi
 
 echo "+ repair fs"
 _repair_scratch_fs >> $seqres.full 2>&1