@@ -6,30 +6,18 @@
# Modify various files after a fuzzing operation
_scratch_fuzz_modify() {
- nr="$1"
+ 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
- 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"
+ 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.