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:
Xiao Yang
2018-11-20 19:58:28 +08:00
committed by Eryu Guan
parent 7022f85ca7
commit ded188b860
42 changed files with 55 additions and 96 deletions
+1 -2
View File
@@ -70,10 +70,9 @@ _scratch_xfs_db -x -c "sb" -c "addr rrmapino" -c "addr u3.rtrmapbt.ptrs[1]" \
-c "stack" -c "blocktrash -x 4096 -y 4096 -n 8 -3 -z" \
>> $seqres.full 2>&1
echo "+ mount image"
echo "+ mount image && copy more"
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