mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
xfs: fix old fuzz test invocations of xfs_repair
Some of the older blocktrash-based fuzz tests cause the fs to go down due to the corrupted image and fail to remount. Offline repair fails because _repair_scratch_fs is the helper that is smart enough to call xfs_repair -L, not _scratch_xfs_repair. Fix these instances. Signed-off-by: Darrick J. Wong <djwong@kernel.org> 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
3427d07e1f
commit
98dff757fc
+4
-4
@@ -44,7 +44,7 @@ scratch_repair() {
|
|||||||
|
|
||||||
FSCK_LOG="${tmp}-fuzz-${fsck_pass}.log"
|
FSCK_LOG="${tmp}-fuzz-${fsck_pass}.log"
|
||||||
echo "++ fsck pass ${fsck_pass}" > "${FSCK_LOG}"
|
echo "++ fsck pass ${fsck_pass}" > "${FSCK_LOG}"
|
||||||
_scratch_xfs_repair >> "${FSCK_LOG}" 2>&1
|
_repair_scratch_fs >> "${FSCK_LOG}" 2>&1
|
||||||
res=$?
|
res=$?
|
||||||
if [ "${res}" -eq 0 ]; then
|
if [ "${res}" -eq 0 ]; then
|
||||||
echo "++ allegedly fixed, reverify" >> "${FSCK_LOG}"
|
echo "++ allegedly fixed, reverify" >> "${FSCK_LOG}"
|
||||||
@@ -105,7 +105,7 @@ echo "+ populate fs image" >> $seqres.full
|
|||||||
_scratch_populate >> $seqres.full
|
_scratch_populate >> $seqres.full
|
||||||
|
|
||||||
echo "+ check fs" >> $seqres.full
|
echo "+ check fs" >> $seqres.full
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1 || _fail "should pass initial fsck"
|
_repair_scratch_fs >> $seqres.full 2>&1 || _fail "should pass initial fsck"
|
||||||
|
|
||||||
echo "++ corrupt image" >> $seqres.full
|
echo "++ corrupt image" >> $seqres.full
|
||||||
_scratch_xfs_db -x -c blockget -c "blocktrash ${FUZZ_ARGS}" >> $seqres.full 2>&1
|
_scratch_xfs_db -x -c blockget -c "blocktrash ${FUZZ_ARGS}" >> $seqres.full 2>&1
|
||||||
@@ -129,7 +129,7 @@ done
|
|||||||
echo "+ fsck loop returns ${fsck_loop_ret}" >> $seqres.full
|
echo "+ fsck loop returns ${fsck_loop_ret}" >> $seqres.full
|
||||||
|
|
||||||
echo "++ check fs for round 2" >> $seqres.full
|
echo "++ check fs for round 2" >> $seqres.full
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
ROUND2_LOG="${tmp}-round2-${fsck_pass}.log"
|
ROUND2_LOG="${tmp}-round2-${fsck_pass}.log"
|
||||||
echo "++ mount image (2)" >> $ROUND2_LOG
|
echo "++ mount image (2)" >> $ROUND2_LOG
|
||||||
@@ -150,7 +150,7 @@ umount "${SCRATCH_MNT}" >> $ROUND2_LOG 2>&1
|
|||||||
cat "$ROUND2_LOG" >> $seqres.full
|
cat "$ROUND2_LOG" >> $seqres.full
|
||||||
|
|
||||||
echo "++ check fs (2)" >> $seqres.full
|
echo "++ check fs (2)" >> $seqres.full
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
egrep -q '(did not fix|makes no progress)' $seqres.full && echo "xfs_repair failed" | tee -a $seqres.full
|
egrep -q '(did not fix|makes no progress)' $seqres.full && echo "xfs_repair failed" | tee -a $seqres.full
|
||||||
if [ "$(wc -l < "$ROUND2_LOG")" -ne 8 ]; then
|
if [ "$(wc -l < "$ROUND2_LOG")" -ne 8 ]; then
|
||||||
|
|||||||
+1
-1
@@ -75,7 +75,7 @@ echo "+ mount image"
|
|||||||
_try_scratch_mount 2>/dev/null && _fail "mount should not succeed"
|
_try_scratch_mount 2>/dev/null && _fail "mount should not succeed"
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image (2)"
|
echo "+ mount image (2)"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
|
|||||||
+2
-2
@@ -86,7 +86,7 @@ if _try_scratch_mount >> $seqres.full 2>&1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image"
|
echo "+ mount image"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
@@ -109,7 +109,7 @@ done
|
|||||||
umount "${SCRATCH_MNT}"
|
umount "${SCRATCH_MNT}"
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image"
|
echo "+ mount image"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
|
|||||||
+1
-1
@@ -86,7 +86,7 @@ fi
|
|||||||
echo "broken: ${broken}"
|
echo "broken: ${broken}"
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image (2)"
|
echo "+ mount image (2)"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
|
|||||||
+2
-2
@@ -85,7 +85,7 @@ if _try_scratch_mount >> $seqres.full 2>&1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image"
|
echo "+ mount image"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
@@ -108,7 +108,7 @@ done
|
|||||||
umount "${SCRATCH_MNT}"
|
umount "${SCRATCH_MNT}"
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image"
|
echo "+ mount image"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
|
|||||||
+2
-2
@@ -85,7 +85,7 @@ if _try_scratch_mount >> $seqres.full 2>&1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image"
|
echo "+ mount image"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
@@ -109,7 +109,7 @@ done
|
|||||||
umount "${SCRATCH_MNT}"
|
umount "${SCRATCH_MNT}"
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image"
|
echo "+ mount image"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
|
|||||||
+2
-2
@@ -85,7 +85,7 @@ if _try_scratch_mount >> $seqres.full 2>&1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image"
|
echo "+ mount image"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
@@ -109,7 +109,7 @@ done
|
|||||||
umount "${SCRATCH_MNT}"
|
umount "${SCRATCH_MNT}"
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image"
|
echo "+ mount image"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
|
|||||||
+1
-1
@@ -86,7 +86,7 @@ fi
|
|||||||
echo "broken: ${broken}"
|
echo "broken: ${broken}"
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image (2)"
|
echo "+ mount image (2)"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
|
|||||||
+1
-1
@@ -88,7 +88,7 @@ fi
|
|||||||
echo "broken: ${broken}"
|
echo "broken: ${broken}"
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image (2)"
|
echo "+ mount image (2)"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
|
|||||||
+2
-2
@@ -74,8 +74,8 @@ if _try_scratch_mount >> $seqres.full 2>&1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image (2)"
|
echo "+ mount image (2)"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
|
|||||||
+2
-2
@@ -79,8 +79,8 @@ if _try_scratch_mount >> $seqres.full 2>&1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image (2)"
|
echo "+ mount image (2)"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
|
|||||||
+2
-2
@@ -74,8 +74,8 @@ if _try_scratch_mount >> $seqres.full 2>&1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image (2)"
|
echo "+ mount image (2)"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
|
|||||||
+2
-2
@@ -79,8 +79,8 @@ if _try_scratch_mount >> $seqres.full 2>&1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image (2)"
|
echo "+ mount image (2)"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
|
|||||||
+2
-2
@@ -79,8 +79,8 @@ if _try_scratch_mount >> $seqres.full 2>&1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image (2)"
|
echo "+ mount image (2)"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
|
|||||||
+2
-2
@@ -79,11 +79,11 @@ if _try_scratch_mount >> $seqres.full 2>&1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
if [ $? -eq 2 ]; then
|
if [ $? -eq 2 ]; then
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
umount "${SCRATCH_MNT}"
|
umount "${SCRATCH_MNT}"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "+ mount image (2)"
|
echo "+ mount image (2)"
|
||||||
|
|||||||
+2
-2
@@ -79,8 +79,8 @@ if _try_scratch_mount >> $seqres.full 2>&1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image (2)"
|
echo "+ mount image (2)"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
|
|||||||
+1
-1
@@ -88,7 +88,7 @@ fi
|
|||||||
echo "broken: ${broken}"
|
echo "broken: ${broken}"
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image (2)"
|
echo "+ mount image (2)"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
|
|||||||
+1
-1
@@ -73,7 +73,7 @@ if _try_scratch_mount >> $seqres.full 2>&1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image (2)"
|
echo "+ mount image (2)"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
|
|||||||
+1
-1
@@ -69,7 +69,7 @@ if _try_scratch_mount >> $seqres.full 2>&1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image (2)"
|
echo "+ mount image (2)"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
|
|||||||
+2
-2
@@ -78,8 +78,8 @@ if _try_scratch_mount >> $seqres.full 2>&1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "+ repair fs"
|
echo "+ repair fs"
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
_scratch_xfs_repair >> $seqres.full 2>&1
|
_repair_scratch_fs >> $seqres.full 2>&1
|
||||||
|
|
||||||
echo "+ mount image (2)"
|
echo "+ mount image (2)"
|
||||||
_scratch_mount
|
_scratch_mount
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user