]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common/fuzzy: exercise the filesystem a little harder after repairing
authorDarrick J. Wong <djwong@kernel.org>
Fri, 30 Dec 2022 22:19:41 +0000 (14:19 -0800)
committerZorro Lang <zlang@kernel.org>
Sat, 25 Feb 2023 13:13:11 +0000 (21:13 +0800)
Use fsstress to exercise the filesystem a little more strenuously after
we've run the fuzzing repair strategy, so that we have a better chance
of tripping over corruption problems.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/fuzzy

index af46415c726bbe3ab524c51233041d4b9fcbe1ad..d2039d201fd52218424c6d40ad2fdba6834c81fb 100644 (file)
@@ -6,30 +6,18 @@
 
 # Modify various files after a fuzzing operation
 _scratch_fuzz_modify() {
-       nr="$1"
-
-       test -z "${nr}" && nr=50000
-       echo "+++ touch ${nr} files"
-       blk_sz=$(stat -f -c '%s' ${SCRATCH_MNT})
-       $XFS_IO_PROG -f -c "pwrite -S 0x63 0 ${blk_sz}" "/tmp/afile" > /dev/null
-       date="$(date)"
-       find "${SCRATCH_MNT}/" -type f 2> /dev/null | head -n "${nr}" | while read f; do
-               # try to remove append, immutable (and even dax) flag if exists
-               $XFS_IO_PROG -rc 'chattr -x -i -a' "$f" > /dev/null 2>&1
-               setfattr -n "user.date" -v "${date}" "$f"
-               cat "/tmp/afile" >> "$f"
-               mv "$f" "$f.longer"
-       done
-       sync
-       rm -rf "/tmp/afile"
-
-       echo "+++ create files"
-       mkdir -p "${SCRATCH_MNT}/test.moo"
-       $XFS_IO_PROG -f -c 'pwrite -S 0x80 0 65536' "${SCRATCH_MNT}/test.moo/urk" > /dev/null
-       sync
-
-       echo "+++ remove files"
-       rm -rf "${SCRATCH_MNT}/test.moo"
+       echo "+++ stressing filesystem"
+       mkdir -p $SCRATCH_MNT/data
+       _xfs_force_bdev data $SCRATCH_MNT/data
+       $FSSTRESS_PROG -n $((TIME_FACTOR * 10000)) -p $((LOAD_FACTOR * 4)) -d $SCRATCH_MNT/data
+
+       if _xfs_has_feature "$SCRATCH_MNT" realtime; then
+               mkdir -p $SCRATCH_MNT/rt
+               _xfs_force_bdev realtime $SCRATCH_MNT/rt
+               $FSSTRESS_PROG -n $((TIME_FACTOR * 10000)) -p $((LOAD_FACTOR * 4)) -d $SCRATCH_MNT/rt
+       else
+               echo "+++ xfs realtime not configured"
+       fi
 }
 
 # Try to access files after fuzzing
@@ -429,7 +417,7 @@ _scratch_xfs_fuzz_field_modifyfs() {
 
        # Try modifying the filesystem again
        __fuzz_notify "++ Try to write filesystem again"
-       _scratch_fuzz_modify 100 2>&1
+       _scratch_fuzz_modify 2>&1
 
        # If we didn't repair anything, there's no point in checking further,
        # the fs is still corrupt.