[PATCH 19/24] common/fuzzy: exercise the filesystem a little harder after repairing

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



From: Darrick J. Wong <djwong@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 common/fuzzy |   36 ++++++++++++------------------------
 1 file changed, 12 insertions(+), 24 deletions(-)


diff --git a/common/fuzzy b/common/fuzzy
index d841d435eb..3de6f43dc6 100644
--- a/common/fuzzy
+++ b/common/fuzzy
@@ -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.




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux