* [PATCH v2 0/2] Ensure _scratch_fuzz_modify() works for other filesystems
@ 2024-03-15 17:13 Luis Henriques (SUSE)
2024-03-15 17:13 ` [PATCH v2 1/2] common/fuzzy: make _scratch_fuzz_modify work for non-xfs filesystems Luis Henriques (SUSE)
2024-03-15 17:13 ` [PATCH v2 2/2] ext4/006: take into account updates to _scratch_fuzz_modify() Luis Henriques (SUSE)
0 siblings, 2 replies; 5+ messages in thread
From: Luis Henriques (SUSE) @ 2024-03-15 17:13 UTC (permalink / raw)
To: fstests; +Cc: Darrick J . Wong, Luis Henriques (SUSE)
Hi!
I guess test ext4/006 isn't executed very often, because as far as I can see
it has been broken for quite some time. The problem is that the function
_scratch_fuzz_modify() is executing xfs-specific operations that will make
this test fail.
The first patch updates this function so that xfs-specific operations are
executed only when that filesystem is being tested.
The second patch simply updates the test to take into account the new output
of the function (and yeah, counting log lines is an ugly hack).
Changes since v1:
* Updated the second patch commit message to add further details on what
changed with the test output.
Luis Henriques (SUSE) (2):
common/fuzzy: make _scratch_fuzz_modify work for non-xfs filesystems
ext4/006: take into account updates to _scratch_fuzz_modify()
common/fuzzy | 16 +++++++++-------
tests/ext4/006 | 2 +-
2 files changed, 10 insertions(+), 8 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/2] common/fuzzy: make _scratch_fuzz_modify work for non-xfs filesystems
2024-03-15 17:13 [PATCH v2 0/2] Ensure _scratch_fuzz_modify() works for other filesystems Luis Henriques (SUSE)
@ 2024-03-15 17:13 ` Luis Henriques (SUSE)
2024-03-20 1:20 ` Darrick J. Wong
2024-03-15 17:13 ` [PATCH v2 2/2] ext4/006: take into account updates to _scratch_fuzz_modify() Luis Henriques (SUSE)
1 sibling, 1 reply; 5+ messages in thread
From: Luis Henriques (SUSE) @ 2024-03-15 17:13 UTC (permalink / raw)
To: fstests; +Cc: Darrick J . Wong, Luis Henriques (SUSE)
Since commit 9bab148bb3c7 ("common/fuzzy: exercise the filesystem a little
harder after repairing") funtion _scratch_fuzz_modify() has become
xfs-specific due to the use of some functions that assume this filesytem,
namely _xfs_force_bdev() and _xfs_has_feature().
Ensure _scratch_fuzz_modify() works again with other filesystems by using
these functions only when testing xfs.
Signed-off-by: Luis Henriques (SUSE) <luis.henriques@linux.dev>
---
common/fuzzy | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/common/fuzzy b/common/fuzzy
index f5d45cb28f07..218fe1654386 100644
--- a/common/fuzzy
+++ b/common/fuzzy
@@ -8,15 +8,17 @@
_scratch_fuzz_modify() {
echo "+++ stressing filesystem"
mkdir -p $SCRATCH_MNT/data
- _xfs_force_bdev data $SCRATCH_MNT/data
+ [ "$FSTYP" == "xfs" ] && _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"
+ if [ "$FSTYP" = "xfs" ]; then
+ 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
fi
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] ext4/006: take into account updates to _scratch_fuzz_modify()
2024-03-15 17:13 [PATCH v2 0/2] Ensure _scratch_fuzz_modify() works for other filesystems Luis Henriques (SUSE)
2024-03-15 17:13 ` [PATCH v2 1/2] common/fuzzy: make _scratch_fuzz_modify work for non-xfs filesystems Luis Henriques (SUSE)
@ 2024-03-15 17:13 ` Luis Henriques (SUSE)
2024-03-20 1:21 ` Darrick J. Wong
1 sibling, 1 reply; 5+ messages in thread
From: Luis Henriques (SUSE) @ 2024-03-15 17:13 UTC (permalink / raw)
To: fstests; +Cc: Darrick J . Wong, Luis Henriques (SUSE)
Test ext4/006 takes into account the number of lines produced by its own
output. However, changes introduced to function _scratch_fuzz_modify() by
commit 9bab148bb3c7 ("common/fuzzy: exercise the filesystem a little harder
after repairing"), modified the output. Namely, the following three lines
were removed:
echo "+++ touch ${nr} files"
echo "+++ create files"
echo "+++ remove files"
And a new one was added:
echo "+++ stressing filesystem"
However, the usage of 'fsstress' also added an extra line with:
printf("seed = %ld\n", seed);
So the delta is one line (-3 + 2).
Modify test ext4/006 to take this change into account.
Signed-off-by: Luis Henriques (SUSE) <luis.henriques@linux.dev>
---
tests/ext4/006 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/ext4/006 b/tests/ext4/006
index 8792167bd9c2..b73692aa5b81 100755
--- a/tests/ext4/006
+++ b/tests/ext4/006
@@ -131,7 +131,7 @@ echo "++ check fs (2)" >> $seqres.full
_check_scratch_fs >> $seqres.full 2>&1
grep -E -q '(did not fix|makes no progress)' $seqres.full && echo "e2fsck failed" | tee -a $seqres.full
-if [ "$(wc -l < "$ROUND2_LOG")" -ne 8 ]; then
+if [ "$(wc -l < "$ROUND2_LOG")" -ne 7 ]; then
echo "e2fsck did not fix everything" | tee -a $seqres.full
fi
echo "finished fuzzing" | tee -a "$seqres.full"
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/2] common/fuzzy: make _scratch_fuzz_modify work for non-xfs filesystems
2024-03-15 17:13 ` [PATCH v2 1/2] common/fuzzy: make _scratch_fuzz_modify work for non-xfs filesystems Luis Henriques (SUSE)
@ 2024-03-20 1:20 ` Darrick J. Wong
0 siblings, 0 replies; 5+ messages in thread
From: Darrick J. Wong @ 2024-03-20 1:20 UTC (permalink / raw)
To: Luis Henriques (SUSE); +Cc: fstests
On Fri, Mar 15, 2024 at 05:13:24PM +0000, Luis Henriques (SUSE) wrote:
> Since commit 9bab148bb3c7 ("common/fuzzy: exercise the filesystem a little
> harder after repairing") funtion _scratch_fuzz_modify() has become
> xfs-specific due to the use of some functions that assume this filesytem,
> namely _xfs_force_bdev() and _xfs_has_feature().
>
> Ensure _scratch_fuzz_modify() works again with other filesystems by using
> these functions only when testing xfs.
>
> Signed-off-by: Luis Henriques (SUSE) <luis.henriques@linux.dev>
Still looks ok,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
> ---
> common/fuzzy | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/common/fuzzy b/common/fuzzy
> index f5d45cb28f07..218fe1654386 100644
> --- a/common/fuzzy
> +++ b/common/fuzzy
> @@ -8,15 +8,17 @@
> _scratch_fuzz_modify() {
> echo "+++ stressing filesystem"
> mkdir -p $SCRATCH_MNT/data
> - _xfs_force_bdev data $SCRATCH_MNT/data
> + [ "$FSTYP" == "xfs" ] && _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"
> + if [ "$FSTYP" = "xfs" ]; then
> + 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
> fi
> }
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 2/2] ext4/006: take into account updates to _scratch_fuzz_modify()
2024-03-15 17:13 ` [PATCH v2 2/2] ext4/006: take into account updates to _scratch_fuzz_modify() Luis Henriques (SUSE)
@ 2024-03-20 1:21 ` Darrick J. Wong
0 siblings, 0 replies; 5+ messages in thread
From: Darrick J. Wong @ 2024-03-20 1:21 UTC (permalink / raw)
To: Luis Henriques (SUSE); +Cc: fstests
On Fri, Mar 15, 2024 at 05:13:25PM +0000, Luis Henriques (SUSE) wrote:
> Test ext4/006 takes into account the number of lines produced by its own
> output. However, changes introduced to function _scratch_fuzz_modify() by
> commit 9bab148bb3c7 ("common/fuzzy: exercise the filesystem a little harder
> after repairing"), modified the output. Namely, the following three lines
> were removed:
>
> echo "+++ touch ${nr} files"
> echo "+++ create files"
> echo "+++ remove files"
>
> And a new one was added:
>
> echo "+++ stressing filesystem"
>
> However, the usage of 'fsstress' also added an extra line with:
>
> printf("seed = %ld\n", seed);
>
> So the delta is one line (-3 + 2).
>
> Modify test ext4/006 to take this change into account.
>
> Signed-off-by: Luis Henriques (SUSE) <luis.henriques@linux.dev>
Thanks for updating the commit message,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
> ---
> tests/ext4/006 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/ext4/006 b/tests/ext4/006
> index 8792167bd9c2..b73692aa5b81 100755
> --- a/tests/ext4/006
> +++ b/tests/ext4/006
> @@ -131,7 +131,7 @@ echo "++ check fs (2)" >> $seqres.full
> _check_scratch_fs >> $seqres.full 2>&1
>
> grep -E -q '(did not fix|makes no progress)' $seqres.full && echo "e2fsck failed" | tee -a $seqres.full
> -if [ "$(wc -l < "$ROUND2_LOG")" -ne 8 ]; then
> +if [ "$(wc -l < "$ROUND2_LOG")" -ne 7 ]; then
> echo "e2fsck did not fix everything" | tee -a $seqres.full
> fi
> echo "finished fuzzing" | tee -a "$seqres.full"
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-03-20 1:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-15 17:13 [PATCH v2 0/2] Ensure _scratch_fuzz_modify() works for other filesystems Luis Henriques (SUSE)
2024-03-15 17:13 ` [PATCH v2 1/2] common/fuzzy: make _scratch_fuzz_modify work for non-xfs filesystems Luis Henriques (SUSE)
2024-03-20 1:20 ` Darrick J. Wong
2024-03-15 17:13 ` [PATCH v2 2/2] ext4/006: take into account updates to _scratch_fuzz_modify() Luis Henriques (SUSE)
2024-03-20 1:21 ` Darrick J. Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox