public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Ensure _scratch_fuzz_modify() works for other filesystems
@ 2024-03-14 17:25 Luis Henriques (SUSE)
  2024-03-14 17:25 ` [PATCH 1/2] common/fuzzy: make _scratch_fuzz_modify work for non-xfs filesystems Luis Henriques (SUSE)
  2024-03-14 17:25 ` [PATCH 2/2] ext4/006: take into account updates to _scratch_fuzz_modify() Luis Henriques (SUSE)
  0 siblings, 2 replies; 7+ messages in thread
From: Luis Henriques (SUSE) @ 2024-03-14 17:25 UTC (permalink / raw)
  To: fstests; +Cc: 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).

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] 7+ messages in thread

* [PATCH 1/2] common/fuzzy: make _scratch_fuzz_modify work for non-xfs filesystems
  2024-03-14 17:25 [PATCH 0/2] Ensure _scratch_fuzz_modify() works for other filesystems Luis Henriques (SUSE)
@ 2024-03-14 17:25 ` Luis Henriques (SUSE)
  2024-03-15  2:49   ` Darrick J. Wong
  2024-03-14 17:25 ` [PATCH 2/2] ext4/006: take into account updates to _scratch_fuzz_modify() Luis Henriques (SUSE)
  1 sibling, 1 reply; 7+ messages in thread
From: Luis Henriques (SUSE) @ 2024-03-14 17:25 UTC (permalink / raw)
  To: fstests; +Cc: 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] 7+ messages in thread

* [PATCH 2/2] ext4/006: take into account updates to _scratch_fuzz_modify()
  2024-03-14 17:25 [PATCH 0/2] Ensure _scratch_fuzz_modify() works for other filesystems Luis Henriques (SUSE)
  2024-03-14 17:25 ` [PATCH 1/2] common/fuzzy: make _scratch_fuzz_modify work for non-xfs filesystems Luis Henriques (SUSE)
@ 2024-03-14 17:25 ` Luis Henriques (SUSE)
  2024-03-15  2:51   ` Darrick J. Wong
  1 sibling, 1 reply; 7+ messages in thread
From: Luis Henriques (SUSE) @ 2024-03-14 17:25 UTC (permalink / raw)
  To: fstests; +Cc: Luis Henriques (SUSE)

Since function _scratch_fuzz_modify() has been updated, its output has
changed.  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] 7+ messages in thread

* Re: [PATCH 1/2] common/fuzzy: make _scratch_fuzz_modify work for non-xfs filesystems
  2024-03-14 17:25 ` [PATCH 1/2] common/fuzzy: make _scratch_fuzz_modify work for non-xfs filesystems Luis Henriques (SUSE)
@ 2024-03-15  2:49   ` Darrick J. Wong
  0 siblings, 0 replies; 7+ messages in thread
From: Darrick J. Wong @ 2024-03-15  2:49 UTC (permalink / raw)
  To: Luis Henriques (SUSE); +Cc: fstests

On Thu, Mar 14, 2024 at 05:25:11PM +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>

Oooooops sorry about that. :(
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] 7+ messages in thread

* Re: [PATCH 2/2] ext4/006: take into account updates to _scratch_fuzz_modify()
  2024-03-14 17:25 ` [PATCH 2/2] ext4/006: take into account updates to _scratch_fuzz_modify() Luis Henriques (SUSE)
@ 2024-03-15  2:51   ` Darrick J. Wong
  2024-03-15  9:11     ` Luis Henriques
  0 siblings, 1 reply; 7+ messages in thread
From: Darrick J. Wong @ 2024-03-15  2:51 UTC (permalink / raw)
  To: Luis Henriques (SUSE); +Cc: fstests

On Thu, Mar 14, 2024 at 05:25:12PM +0000, Luis Henriques (SUSE) wrote:
> Since function _scratch_fuzz_modify() has been updated, its output has
> changed.  Modify test ext4/006 to take this change into account.

Now that you've blocked off the XFS stuff, what line changed?

--D

> 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	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] ext4/006: take into account updates to _scratch_fuzz_modify()
  2024-03-15  2:51   ` Darrick J. Wong
@ 2024-03-15  9:11     ` Luis Henriques
  2024-03-15 15:37       ` Darrick J. Wong
  0 siblings, 1 reply; 7+ messages in thread
From: Luis Henriques @ 2024-03-15  9:11 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: fstests

"Darrick J. Wong" <djwong@kernel.org> writes:

> On Thu, Mar 14, 2024 at 05:25:12PM +0000, Luis Henriques (SUSE) wrote:
>> Since function _scratch_fuzz_modify() has been updated, its output has
>> changed.  Modify test ext4/006 to take this change into account.
>
> Now that you've blocked off the XFS stuff, what line changed?

Well, there are three lines that are gone with commit 9bab148bb3c7:

	echo "+++ touch ${nr} files"
	echo "+++ create files"
	echo "+++ remove files"

And a new one was added:

	echo "+++ stressing filesystem"

However, running fsstress will also add a new line with:

	printf("seed = %ld\n", seed);

So the delta is one line (seven instead of eight).

Cheers,
-- 
Luís

>
> --D
>
>> 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	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] ext4/006: take into account updates to _scratch_fuzz_modify()
  2024-03-15  9:11     ` Luis Henriques
@ 2024-03-15 15:37       ` Darrick J. Wong
  0 siblings, 0 replies; 7+ messages in thread
From: Darrick J. Wong @ 2024-03-15 15:37 UTC (permalink / raw)
  To: Luis Henriques; +Cc: fstests

On Fri, Mar 15, 2024 at 09:11:32AM +0000, Luis Henriques wrote:
> "Darrick J. Wong" <djwong@kernel.org> writes:
> 
> > On Thu, Mar 14, 2024 at 05:25:12PM +0000, Luis Henriques (SUSE) wrote:
> >> Since function _scratch_fuzz_modify() has been updated, its output has
> >> changed.  Modify test ext4/006 to take this change into account.
> >
> > Now that you've blocked off the XFS stuff, what line changed?
> 
> Well, there are three lines that are gone with commit 9bab148bb3c7:
> 
> 	echo "+++ touch ${nr} files"
> 	echo "+++ create files"
> 	echo "+++ remove files"
> 
> And a new one was added:
> 
> 	echo "+++ stressing filesystem"
> 
> However, running fsstress will also add a new line with:
> 
> 	printf("seed = %ld\n", seed);
> 
> So the delta is one line (seven instead of eight).

Ah, ok.  Can you copy-paste that into the commit message so that we have
some record of what caused the need for the adjustment, please?

With that added,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>


--D

> Cheers,
> -- 
> Luís
> 
> >
> > --D
> >
> >> 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	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-03-15 15:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-14 17:25 [PATCH 0/2] Ensure _scratch_fuzz_modify() works for other filesystems Luis Henriques (SUSE)
2024-03-14 17:25 ` [PATCH 1/2] common/fuzzy: make _scratch_fuzz_modify work for non-xfs filesystems Luis Henriques (SUSE)
2024-03-15  2:49   ` Darrick J. Wong
2024-03-14 17:25 ` [PATCH 2/2] ext4/006: take into account updates to _scratch_fuzz_modify() Luis Henriques (SUSE)
2024-03-15  2:51   ` Darrick J. Wong
2024-03-15  9:11     ` Luis Henriques
2024-03-15 15:37       ` 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