mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
xfs: Fix the situation that mount operation rejects corrupted XFS
On upstream kernel, running some tests which corrupt XFS on purpose
got the mismatched output. e.g. running xfs/087:
------------------------------------------------
+ check fs
+ corrupt image
+ mount image
-+ modify files
-broken: 1
+ repair fs
+ mount image (2)
------------------------------------------------
It is reasonable for corrupted XFS to be caught and rejected by mount
or read/write operation.
Fixes: 0828657542 ("xfs: fix blocktrash fuzzers")
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
+4
-5
@@ -75,17 +75,16 @@ for ag in $(seq 1 $((agcount - 1))) 0; do
|
||||
_scratch_xfs_db -x -c "agi ${ag}" -c "agi ${ag}" -c "addr root" -c "stack" -c "blocktrash -x 32 -y $((blksz * 8)) -z ${FUZZ_ARGS}" >> $seqres.full 2>&1
|
||||
done
|
||||
|
||||
echo "+ mount image"
|
||||
echo "+ mount image && modify files"
|
||||
broken=1
|
||||
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
|
||||
touch "${TESTFILE}.${x}" 2> /dev/null && broken=0
|
||||
done
|
||||
echo "broken: ${broken}"
|
||||
umount "${SCRATCH_MNT}"
|
||||
fi
|
||||
echo "broken: ${broken}"
|
||||
|
||||
echo "+ repair fs"
|
||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
||||
|
||||
Reference in New Issue
Block a user