xfs: fix blocktrash fuzzers

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>
This commit is contained in:
Darrick J. Wong
2018-05-01 08:40:17 -07:00
committed by Eryu Guan
parent e2fd1a080e
commit 0828657542
22 changed files with 148 additions and 126 deletions
+7 -6
View File
@@ -93,13 +93,14 @@ done
# Try to append to files; this should fail
echo "+ mount image"
_scratch_mount
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}"
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