mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
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:
committed by
Eryu Guan
parent
e2fd1a080e
commit
0828657542
+7
-6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user