fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET 0/5] fstests: miscellaneous fixes
@ 2021-04-28  4:08 Darrick J. Wong
  2021-04-28  4:09 ` [PATCH 1/5] xfs/276: remove unnecessary mkfs golden output Darrick J. Wong
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Darrick J. Wong @ 2021-04-28  4:08 UTC (permalink / raw)
  To: djwong, guaneryu; +Cc: linux-xfs, fstests, guan

Hi all,

Various small fixes to the fstests suite.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=random-fixes

xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=random-fixes

fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=random-fixes
---
 common/rc         |    3 ++-
 tests/generic/094 |    2 +-
 tests/generic/225 |    2 +-
 tests/generic/449 |    5 +++++
 tests/xfs/004     |    4 ++++
 tests/xfs/276     |    2 +-
 tests/xfs/491     |    5 +++++
 tests/xfs/492     |    5 +++++
 8 files changed, 24 insertions(+), 4 deletions(-)


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/5] xfs/276: remove unnecessary mkfs golden output
  2021-04-28  4:08 [PATCHSET 0/5] fstests: miscellaneous fixes Darrick J. Wong
@ 2021-04-28  4:09 ` Darrick J. Wong
  2021-04-28 17:47   ` Brian Foster
  2021-04-28  4:09 ` [PATCH 2/5] generic/{094,225}: fix argument to _require_file_block_size_equals_fs_block_size Darrick J. Wong
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Darrick J. Wong @ 2021-04-28  4:09 UTC (permalink / raw)
  To: djwong, guaneryu; +Cc: linux-xfs, fstests, guan

From: Darrick J. Wong <djwong@kernel.org>

A previous update to this test dropped the clause where the mkfs
standard output gets sent to /dev/null.  The filtered mkfs output isn't
needed here and it breaks the test, so fix that.

Fixes: e97f96e5 ("xfs/27[26]: force realtime on or off as needed")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/xfs/276 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/tests/xfs/276 b/tests/xfs/276
index 6e2b2fb4..afea48ad 100755
--- a/tests/xfs/276
+++ b/tests/xfs/276
@@ -35,7 +35,7 @@ _require_test_program "punch-alternating"
 rm -f "$seqres.full"
 
 echo "Format and mount"
-_scratch_mkfs | _filter_mkfs 2> "$tmp.mkfs"
+_scratch_mkfs | _filter_mkfs 2> "$tmp.mkfs" >/dev/null
 . $tmp.mkfs
 cat "$tmp.mkfs" > $seqres.full
 _scratch_mount


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/5] generic/{094,225}: fix argument to _require_file_block_size_equals_fs_block_size
  2021-04-28  4:08 [PATCHSET 0/5] fstests: miscellaneous fixes Darrick J. Wong
  2021-04-28  4:09 ` [PATCH 1/5] xfs/276: remove unnecessary mkfs golden output Darrick J. Wong
@ 2021-04-28  4:09 ` Darrick J. Wong
  2021-04-28 17:47   ` Brian Foster
  2021-04-28  4:09 ` [PATCH 3/5] generic/449: always fill up the data device Darrick J. Wong
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Darrick J. Wong @ 2021-04-28  4:09 UTC (permalink / raw)
  To: djwong, guaneryu; +Cc: linux-xfs, fstests, guan

From: Darrick J. Wong <djwong@kernel.org>

Fix the incorrect parameter being passed to this new predicate.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 common/rc         |    3 ++-
 tests/generic/094 |    2 +-
 tests/generic/225 |    2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)


diff --git a/common/rc b/common/rc
index 2cf550ec..6752c92d 100644
--- a/common/rc
+++ b/common/rc
@@ -4174,7 +4174,8 @@ _get_block_size()
 }
 
 # Require that the fundamental allocation unit of a file is the same as the
-# filesystem block size.
+# filesystem block size.  The sole parameter must be the root dir of a
+# filesystem.
 _require_file_block_size_equals_fs_block_size()
 {
 	local file_alloc_unit="$(_get_file_block_size $1)"
diff --git a/tests/generic/094 b/tests/generic/094
index 8c292473..20ef158e 100755
--- a/tests/generic/094
+++ b/tests/generic/094
@@ -43,7 +43,7 @@ _require_test_program "fiemap-tester"
 # FIEMAP test doesn't like finding unwritten blocks after it punches out
 # a partial rt extent.
 test "$FSTYP" = "xfs" && \
-	_require_file_block_size_equals_fs_block_size $fiemapfile
+	_require_file_block_size_equals_fs_block_size $SCRATCH_MNT
 
 seed=`date +%s`
 
diff --git a/tests/generic/225 b/tests/generic/225
index fac688df..1a7963e8 100755
--- a/tests/generic/225
+++ b/tests/generic/225
@@ -43,7 +43,7 @@ _require_test_program "fiemap-tester"
 # FIEMAP test doesn't like finding unwritten blocks after it punches out
 # a partial rt extent.
 test "$FSTYP" = "xfs" && \
-	_require_file_block_size_equals_fs_block_size $fiemapfile
+	_require_file_block_size_equals_fs_block_size $SCRATCH_MNT
 
 seed=`date +%s`
 


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/5] generic/449: always fill up the data device
  2021-04-28  4:08 [PATCHSET 0/5] fstests: miscellaneous fixes Darrick J. Wong
  2021-04-28  4:09 ` [PATCH 1/5] xfs/276: remove unnecessary mkfs golden output Darrick J. Wong
  2021-04-28  4:09 ` [PATCH 2/5] generic/{094,225}: fix argument to _require_file_block_size_equals_fs_block_size Darrick J. Wong
@ 2021-04-28  4:09 ` Darrick J. Wong
  2021-04-28 17:47   ` Brian Foster
  2021-04-28  4:09 ` [PATCH 4/5] xfs/004: don't fail test due to realtime files Darrick J. Wong
  2021-04-28  4:09 ` [PATCH 5/5] xfs/49[12]: skip pre-lazysbcount filesystems Darrick J. Wong
  4 siblings, 1 reply; 15+ messages in thread
From: Darrick J. Wong @ 2021-04-28  4:09 UTC (permalink / raw)
  To: djwong, guaneryu; +Cc: linux-xfs, fstests, guan

From: Darrick J. Wong <djwong@kernel.org>

This is yet another one of those tests that looks at what happens when
we run out of space for more metadata (in this case, xattrs).  Make sure
that the 256M we write to the file to try to stimulate ENOSPC gets
written to the same place that xfs puts xattr data -- the data device.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/generic/449 |    5 +++++
 1 file changed, 5 insertions(+)


diff --git a/tests/generic/449 b/tests/generic/449
index a2d882df..5fd15367 100755
--- a/tests/generic/449
+++ b/tests/generic/449
@@ -43,6 +43,11 @@ _require_attrs trusted
 _scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1
 _scratch_mount || _fail "mount failed"
 
+# This is a test of xattr behavior when we run out of disk space for xattrs,
+# so make sure the pwrite goes to the data device and not the rt volume.
+test "$FSTYP" = "xfs" && \
+	$XFS_IO_PROG -c 'chattr -t' $SCRATCH_MNT
+
 TFILE=$SCRATCH_MNT/testfile.$seq
 
 # Create the test file and choose its permissions


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 4/5] xfs/004: don't fail test due to realtime files
  2021-04-28  4:08 [PATCHSET 0/5] fstests: miscellaneous fixes Darrick J. Wong
                   ` (2 preceding siblings ...)
  2021-04-28  4:09 ` [PATCH 3/5] generic/449: always fill up the data device Darrick J. Wong
@ 2021-04-28  4:09 ` Darrick J. Wong
  2021-04-28 17:47   ` Brian Foster
  2021-04-28  4:09 ` [PATCH 5/5] xfs/49[12]: skip pre-lazysbcount filesystems Darrick J. Wong
  4 siblings, 1 reply; 15+ messages in thread
From: Darrick J. Wong @ 2021-04-28  4:09 UTC (permalink / raw)
  To: djwong, guaneryu; +Cc: linux-xfs, fstests, guan

From: Darrick J. Wong <djwong@kernel.org>

This test exercises xfs_db functionality that relates to the free space
btrees on the data device.  Therefore, make sure that the files we
create are not realtime files.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/xfs/004 |    4 ++++
 1 file changed, 4 insertions(+)


diff --git a/tests/xfs/004 b/tests/xfs/004
index 141cf03a..7633071c 100755
--- a/tests/xfs/004
+++ b/tests/xfs/004
@@ -28,6 +28,10 @@ _populate_scratch()
 	_scratch_mkfs_xfs | tee -a $seqres.full | _filter_mkfs 2>$tmp.mkfs
 	. $tmp.mkfs
 	_scratch_mount
+	# This test looks at specific behaviors of the xfs_db freesp command,
+	# which reports on the contents of the free space btrees for the data
+	# device.  Don't let anything get created on the realtime volume.
+	$XFS_IO_PROG -c 'chattr -t' $SCRATCH_MNT
 	dd if=/dev/zero of=$SCRATCH_MNT/foo count=200 bs=4096 >/dev/null 2>&1 &
 	dd if=/dev/zero of=$SCRATCH_MNT/goo count=400 bs=4096 >/dev/null 2>&1 &
 	dd if=/dev/zero of=$SCRATCH_MNT/moo count=800 bs=4096 >/dev/null 2>&1 &


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 5/5] xfs/49[12]: skip pre-lazysbcount filesystems
  2021-04-28  4:08 [PATCHSET 0/5] fstests: miscellaneous fixes Darrick J. Wong
                   ` (3 preceding siblings ...)
  2021-04-28  4:09 ` [PATCH 4/5] xfs/004: don't fail test due to realtime files Darrick J. Wong
@ 2021-04-28  4:09 ` Darrick J. Wong
  2021-04-28 17:47   ` Brian Foster
  2021-04-29  1:31   ` [PATCH v1.2 " Darrick J. Wong
  4 siblings, 2 replies; 15+ messages in thread
From: Darrick J. Wong @ 2021-04-28  4:09 UTC (permalink / raw)
  To: djwong, guaneryu; +Cc: linux-xfs, fstests, guan

From: Darrick J. Wong <djwong@kernel.org>

Prior to lazysbcount, the xfs mount code blindly trusted the value of
the fdblocks counter in the primary super, which means that the kernel
doesn't detect the fuzzed fdblocks value at all.  V4 is deprecated and
pre-lazysbcount V4 hasn't been the default for ~14 years, so we'll just
skip these two tests on those old filesystems.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/xfs/491 |    5 +++++
 tests/xfs/492 |    5 +++++
 2 files changed, 10 insertions(+)


diff --git a/tests/xfs/491 b/tests/xfs/491
index 6420202b..9fd0ab56 100755
--- a/tests/xfs/491
+++ b/tests/xfs/491
@@ -36,6 +36,11 @@ _require_scratch
 
 echo "Format and mount"
 _scratch_mkfs > $seqres.full 2>&1
+
+# pre-lazysbcount filesystems blindly trust the primary sb fdblocks
+_check_scratch_xfs_features LAZYSBCOUNT &>/dev/null || \
+	_notrun "filesystem requires lazysbcount"
+
 _scratch_mount >> $seqres.full 2>&1
 echo "test file" > $SCRATCH_MNT/testfile
 
diff --git a/tests/xfs/492 b/tests/xfs/492
index 522def47..c4b087b5 100755
--- a/tests/xfs/492
+++ b/tests/xfs/492
@@ -36,6 +36,11 @@ _require_scratch
 
 echo "Format and mount"
 _scratch_mkfs > $seqres.full 2>&1
+
+# pre-lazysbcount filesystems blindly trust the primary sb fdblocks
+_check_scratch_xfs_features LAZYSBCOUNT &>/dev/null || \
+	_notrun "filesystem requires lazysbcount"
+
 _scratch_mount >> $seqres.full 2>&1
 echo "test file" > $SCRATCH_MNT/testfile
 


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/5] xfs/276: remove unnecessary mkfs golden output
  2021-04-28  4:09 ` [PATCH 1/5] xfs/276: remove unnecessary mkfs golden output Darrick J. Wong
@ 2021-04-28 17:47   ` Brian Foster
  0 siblings, 0 replies; 15+ messages in thread
From: Brian Foster @ 2021-04-28 17:47 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: guaneryu, linux-xfs, fstests, guan

On Tue, Apr 27, 2021 at 09:09:00PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> A previous update to this test dropped the clause where the mkfs
> standard output gets sent to /dev/null.  The filtered mkfs output isn't
> needed here and it breaks the test, so fix that.
> 
> Fixes: e97f96e5 ("xfs/27[26]: force realtime on or off as needed")
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  tests/xfs/276 |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 
> diff --git a/tests/xfs/276 b/tests/xfs/276
> index 6e2b2fb4..afea48ad 100755
> --- a/tests/xfs/276
> +++ b/tests/xfs/276
> @@ -35,7 +35,7 @@ _require_test_program "punch-alternating"
>  rm -f "$seqres.full"
>  
>  echo "Format and mount"
> -_scratch_mkfs | _filter_mkfs 2> "$tmp.mkfs"
> +_scratch_mkfs | _filter_mkfs 2> "$tmp.mkfs" >/dev/null
>  . $tmp.mkfs
>  cat "$tmp.mkfs" > $seqres.full
>  _scratch_mount
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/5] generic/{094,225}: fix argument to _require_file_block_size_equals_fs_block_size
  2021-04-28  4:09 ` [PATCH 2/5] generic/{094,225}: fix argument to _require_file_block_size_equals_fs_block_size Darrick J. Wong
@ 2021-04-28 17:47   ` Brian Foster
  0 siblings, 0 replies; 15+ messages in thread
From: Brian Foster @ 2021-04-28 17:47 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: guaneryu, linux-xfs, fstests, guan

On Tue, Apr 27, 2021 at 09:09:06PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Fix the incorrect parameter being passed to this new predicate.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  common/rc         |    3 ++-
>  tests/generic/094 |    2 +-
>  tests/generic/225 |    2 +-
>  3 files changed, 4 insertions(+), 3 deletions(-)
> 
> 
> diff --git a/common/rc b/common/rc
> index 2cf550ec..6752c92d 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -4174,7 +4174,8 @@ _get_block_size()
>  }
>  
>  # Require that the fundamental allocation unit of a file is the same as the
> -# filesystem block size.
> +# filesystem block size.  The sole parameter must be the root dir of a
> +# filesystem.
>  _require_file_block_size_equals_fs_block_size()
>  {
>  	local file_alloc_unit="$(_get_file_block_size $1)"
> diff --git a/tests/generic/094 b/tests/generic/094
> index 8c292473..20ef158e 100755
> --- a/tests/generic/094
> +++ b/tests/generic/094
> @@ -43,7 +43,7 @@ _require_test_program "fiemap-tester"
>  # FIEMAP test doesn't like finding unwritten blocks after it punches out
>  # a partial rt extent.
>  test "$FSTYP" = "xfs" && \
> -	_require_file_block_size_equals_fs_block_size $fiemapfile
> +	_require_file_block_size_equals_fs_block_size $SCRATCH_MNT
>  
>  seed=`date +%s`
>  
> diff --git a/tests/generic/225 b/tests/generic/225
> index fac688df..1a7963e8 100755
> --- a/tests/generic/225
> +++ b/tests/generic/225
> @@ -43,7 +43,7 @@ _require_test_program "fiemap-tester"
>  # FIEMAP test doesn't like finding unwritten blocks after it punches out
>  # a partial rt extent.
>  test "$FSTYP" = "xfs" && \
> -	_require_file_block_size_equals_fs_block_size $fiemapfile
> +	_require_file_block_size_equals_fs_block_size $SCRATCH_MNT
>  
>  seed=`date +%s`
>  
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/5] generic/449: always fill up the data device
  2021-04-28  4:09 ` [PATCH 3/5] generic/449: always fill up the data device Darrick J. Wong
@ 2021-04-28 17:47   ` Brian Foster
  2021-04-29  0:39     ` Darrick J. Wong
  0 siblings, 1 reply; 15+ messages in thread
From: Brian Foster @ 2021-04-28 17:47 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: guaneryu, linux-xfs, fstests, guan

On Tue, Apr 27, 2021 at 09:09:12PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> This is yet another one of those tests that looks at what happens when
> we run out of space for more metadata (in this case, xattrs).  Make sure
> that the 256M we write to the file to try to stimulate ENOSPC gets
> written to the same place that xfs puts xattr data -- the data device.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  tests/generic/449 |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> 
> diff --git a/tests/generic/449 b/tests/generic/449
> index a2d882df..5fd15367 100755
> --- a/tests/generic/449
> +++ b/tests/generic/449
> @@ -43,6 +43,11 @@ _require_attrs trusted
>  _scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1
>  _scratch_mount || _fail "mount failed"
>  
> +# This is a test of xattr behavior when we run out of disk space for xattrs,
> +# so make sure the pwrite goes to the data device and not the rt volume.
> +test "$FSTYP" = "xfs" && \
> +	$XFS_IO_PROG -c 'chattr -t' $SCRATCH_MNT
> +

This seems like the type of thing we'll consistently be playing
whack-a-mole with unless we come up with a better way to manage it. I'm
not sure what the solution for that is though, so:

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  TFILE=$SCRATCH_MNT/testfile.$seq
>  
>  # Create the test file and choose its permissions
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] xfs/004: don't fail test due to realtime files
  2021-04-28  4:09 ` [PATCH 4/5] xfs/004: don't fail test due to realtime files Darrick J. Wong
@ 2021-04-28 17:47   ` Brian Foster
  0 siblings, 0 replies; 15+ messages in thread
From: Brian Foster @ 2021-04-28 17:47 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: guaneryu, linux-xfs, fstests, guan

On Tue, Apr 27, 2021 at 09:09:18PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> This test exercises xfs_db functionality that relates to the free space
> btrees on the data device.  Therefore, make sure that the files we
> create are not realtime files.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  tests/xfs/004 |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> 
> diff --git a/tests/xfs/004 b/tests/xfs/004
> index 141cf03a..7633071c 100755
> --- a/tests/xfs/004
> +++ b/tests/xfs/004
> @@ -28,6 +28,10 @@ _populate_scratch()
>  	_scratch_mkfs_xfs | tee -a $seqres.full | _filter_mkfs 2>$tmp.mkfs
>  	. $tmp.mkfs
>  	_scratch_mount
> +	# This test looks at specific behaviors of the xfs_db freesp command,
> +	# which reports on the contents of the free space btrees for the data
> +	# device.  Don't let anything get created on the realtime volume.
> +	$XFS_IO_PROG -c 'chattr -t' $SCRATCH_MNT
>  	dd if=/dev/zero of=$SCRATCH_MNT/foo count=200 bs=4096 >/dev/null 2>&1 &
>  	dd if=/dev/zero of=$SCRATCH_MNT/goo count=400 bs=4096 >/dev/null 2>&1 &
>  	dd if=/dev/zero of=$SCRATCH_MNT/moo count=800 bs=4096 >/dev/null 2>&1 &
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 5/5] xfs/49[12]: skip pre-lazysbcount filesystems
  2021-04-28  4:09 ` [PATCH 5/5] xfs/49[12]: skip pre-lazysbcount filesystems Darrick J. Wong
@ 2021-04-28 17:47   ` Brian Foster
  2021-04-29  0:44     ` Darrick J. Wong
  2021-04-29  1:31   ` [PATCH v1.2 " Darrick J. Wong
  1 sibling, 1 reply; 15+ messages in thread
From: Brian Foster @ 2021-04-28 17:47 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: guaneryu, linux-xfs, fstests, guan

On Tue, Apr 27, 2021 at 09:09:24PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Prior to lazysbcount, the xfs mount code blindly trusted the value of
> the fdblocks counter in the primary super, which means that the kernel
> doesn't detect the fuzzed fdblocks value at all.  V4 is deprecated and
> pre-lazysbcount V4 hasn't been the default for ~14 years, so we'll just
> skip these two tests on those old filesystems.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  tests/xfs/491 |    5 +++++
>  tests/xfs/492 |    5 +++++
>  2 files changed, 10 insertions(+)
> 
> 
> diff --git a/tests/xfs/491 b/tests/xfs/491
> index 6420202b..9fd0ab56 100755
> --- a/tests/xfs/491
> +++ b/tests/xfs/491
> @@ -36,6 +36,11 @@ _require_scratch
>  
>  echo "Format and mount"
>  _scratch_mkfs > $seqres.full 2>&1
> +
> +# pre-lazysbcount filesystems blindly trust the primary sb fdblocks
> +_check_scratch_xfs_features LAZYSBCOUNT &>/dev/null || \
> +	_notrun "filesystem requires lazysbcount"
> +

Perhaps we should turn this one into a '_require_scratch_xfs_feature
<FEATURE>' helper or some such? Probably not that important for
lazysbcount filtering, but it seems like that might be useful for newer
features going forward.

Brian

>  _scratch_mount >> $seqres.full 2>&1
>  echo "test file" > $SCRATCH_MNT/testfile
>  
> diff --git a/tests/xfs/492 b/tests/xfs/492
> index 522def47..c4b087b5 100755
> --- a/tests/xfs/492
> +++ b/tests/xfs/492
> @@ -36,6 +36,11 @@ _require_scratch
>  
>  echo "Format and mount"
>  _scratch_mkfs > $seqres.full 2>&1
> +
> +# pre-lazysbcount filesystems blindly trust the primary sb fdblocks
> +_check_scratch_xfs_features LAZYSBCOUNT &>/dev/null || \
> +	_notrun "filesystem requires lazysbcount"
> +
>  _scratch_mount >> $seqres.full 2>&1
>  echo "test file" > $SCRATCH_MNT/testfile
>  
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/5] generic/449: always fill up the data device
  2021-04-28 17:47   ` Brian Foster
@ 2021-04-29  0:39     ` Darrick J. Wong
  0 siblings, 0 replies; 15+ messages in thread
From: Darrick J. Wong @ 2021-04-29  0:39 UTC (permalink / raw)
  To: Brian Foster; +Cc: guaneryu, linux-xfs, fstests, guan

On Wed, Apr 28, 2021 at 01:47:33PM -0400, Brian Foster wrote:
> On Tue, Apr 27, 2021 at 09:09:12PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > This is yet another one of those tests that looks at what happens when
> > we run out of space for more metadata (in this case, xattrs).  Make sure
> > that the 256M we write to the file to try to stimulate ENOSPC gets
> > written to the same place that xfs puts xattr data -- the data device.
> > 
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > ---
> >  tests/generic/449 |    5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > 
> > diff --git a/tests/generic/449 b/tests/generic/449
> > index a2d882df..5fd15367 100755
> > --- a/tests/generic/449
> > +++ b/tests/generic/449
> > @@ -43,6 +43,11 @@ _require_attrs trusted
> >  _scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1
> >  _scratch_mount || _fail "mount failed"
> >  
> > +# This is a test of xattr behavior when we run out of disk space for xattrs,
> > +# so make sure the pwrite goes to the data device and not the rt volume.
> > +test "$FSTYP" = "xfs" && \
> > +	$XFS_IO_PROG -c 'chattr -t' $SCRATCH_MNT
> > +
> 
> This seems like the type of thing we'll consistently be playing
> whack-a-mole with unless we come up with a better way to manage it. I'm
> not sure what the solution for that is though, so:

I don't know either, sadly.  Most of the culprits are either
xfs-specific tests that fiddle with the disk format, or ENOSPC testers
that rely on data writes using the same space manager as metadata, or
vice versa.

--D

> Reviewed-by: Brian Foster <bfoster@redhat.com>
> 
> >  TFILE=$SCRATCH_MNT/testfile.$seq
> >  
> >  # Create the test file and choose its permissions
> > 
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 5/5] xfs/49[12]: skip pre-lazysbcount filesystems
  2021-04-28 17:47   ` Brian Foster
@ 2021-04-29  0:44     ` Darrick J. Wong
  0 siblings, 0 replies; 15+ messages in thread
From: Darrick J. Wong @ 2021-04-29  0:44 UTC (permalink / raw)
  To: Brian Foster; +Cc: guaneryu, linux-xfs, fstests, guan

On Wed, Apr 28, 2021 at 01:47:53PM -0400, Brian Foster wrote:
> On Tue, Apr 27, 2021 at 09:09:24PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > Prior to lazysbcount, the xfs mount code blindly trusted the value of
> > the fdblocks counter in the primary super, which means that the kernel
> > doesn't detect the fuzzed fdblocks value at all.  V4 is deprecated and
> > pre-lazysbcount V4 hasn't been the default for ~14 years, so we'll just
> > skip these two tests on those old filesystems.
> > 
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > ---
> >  tests/xfs/491 |    5 +++++
> >  tests/xfs/492 |    5 +++++
> >  2 files changed, 10 insertions(+)
> > 
> > 
> > diff --git a/tests/xfs/491 b/tests/xfs/491
> > index 6420202b..9fd0ab56 100755
> > --- a/tests/xfs/491
> > +++ b/tests/xfs/491
> > @@ -36,6 +36,11 @@ _require_scratch
> >  
> >  echo "Format and mount"
> >  _scratch_mkfs > $seqres.full 2>&1
> > +
> > +# pre-lazysbcount filesystems blindly trust the primary sb fdblocks
> > +_check_scratch_xfs_features LAZYSBCOUNT &>/dev/null || \
> > +	_notrun "filesystem requires lazysbcount"
> > +
> 
> Perhaps we should turn this one into a '_require_scratch_xfs_feature
> <FEATURE>' helper or some such? Probably not that important for
> lazysbcount filtering, but it seems like that might be useful for newer
> features going forward.

Good idea, there are a few more tests in my stack that will need this.

--D

> Brian
> 
> >  _scratch_mount >> $seqres.full 2>&1
> >  echo "test file" > $SCRATCH_MNT/testfile
> >  
> > diff --git a/tests/xfs/492 b/tests/xfs/492
> > index 522def47..c4b087b5 100755
> > --- a/tests/xfs/492
> > +++ b/tests/xfs/492
> > @@ -36,6 +36,11 @@ _require_scratch
> >  
> >  echo "Format and mount"
> >  _scratch_mkfs > $seqres.full 2>&1
> > +
> > +# pre-lazysbcount filesystems blindly trust the primary sb fdblocks
> > +_check_scratch_xfs_features LAZYSBCOUNT &>/dev/null || \
> > +	_notrun "filesystem requires lazysbcount"
> > +
> >  _scratch_mount >> $seqres.full 2>&1
> >  echo "test file" > $SCRATCH_MNT/testfile
> >  
> > 
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v1.2 5/5] xfs/49[12]: skip pre-lazysbcount filesystems
  2021-04-28  4:09 ` [PATCH 5/5] xfs/49[12]: skip pre-lazysbcount filesystems Darrick J. Wong
  2021-04-28 17:47   ` Brian Foster
@ 2021-04-29  1:31   ` Darrick J. Wong
  2021-04-29 13:30     ` Brian Foster
  1 sibling, 1 reply; 15+ messages in thread
From: Darrick J. Wong @ 2021-04-29  1:31 UTC (permalink / raw)
  To: guaneryu; +Cc: linux-xfs, fstests, guan, Brian Foster

From: Darrick J. Wong <djwong@kernel.org>

Prior to lazysbcount, the xfs mount code blindly trusted the value of
the fdblocks counter in the primary super, which means that the kernel
doesn't detect the fuzzed fdblocks value at all.  V4 is deprecated and
pre-lazysbcount V4 hasn't been the default for ~14 years, so we'll just
skip these two tests on those old filesystems.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
v1.2: factor the feature checking into a separate helper
---
 common/xfs    |   12 ++++++++++++
 tests/xfs/491 |    4 ++++
 tests/xfs/492 |    4 ++++
 3 files changed, 20 insertions(+)

diff --git a/common/xfs b/common/xfs
index 8501b084..92383061 100644
--- a/common/xfs
+++ b/common/xfs
@@ -1129,6 +1129,18 @@ _check_scratch_xfs_features()
 	test "${found}" -eq "$#"
 }
 
+# Skip a test if any of the given fs features aren't present on the scratch
+# filesystem.  The scratch fs must have been formatted already.
+_require_scratch_xfs_features()
+{
+	local features="$(_scratch_xfs_db -c 'version' 2>/dev/null)"
+
+	for feature in "$@"; do
+		echo "${features}" | grep -q -w "${feature}" ||
+			_notrun "Missing scratch feature: ${feature}"
+	done
+}
+
 # Decide if xfs_repair knows how to set (or clear) a filesystem feature.
 _require_xfs_repair_upgrade()
 {
diff --git a/tests/xfs/491 b/tests/xfs/491
index 6420202b..7d447ccf 100755
--- a/tests/xfs/491
+++ b/tests/xfs/491
@@ -36,6 +36,10 @@ _require_scratch
 
 echo "Format and mount"
 _scratch_mkfs > $seqres.full 2>&1
+
+# pre-lazysbcount filesystems blindly trust the primary sb fdblocks
+_require_scratch_xfs_features LAZYSBCOUNT
+
 _scratch_mount >> $seqres.full 2>&1
 echo "test file" > $SCRATCH_MNT/testfile
 
diff --git a/tests/xfs/492 b/tests/xfs/492
index 522def47..21c6872f 100755
--- a/tests/xfs/492
+++ b/tests/xfs/492
@@ -36,6 +36,10 @@ _require_scratch
 
 echo "Format and mount"
 _scratch_mkfs > $seqres.full 2>&1
+
+# pre-lazysbcount filesystems blindly trust the primary sb fdblocks
+_require_scratch_xfs_features LAZYSBCOUNT
+
 _scratch_mount >> $seqres.full 2>&1
 echo "test file" > $SCRATCH_MNT/testfile
 

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v1.2 5/5] xfs/49[12]: skip pre-lazysbcount filesystems
  2021-04-29  1:31   ` [PATCH v1.2 " Darrick J. Wong
@ 2021-04-29 13:30     ` Brian Foster
  0 siblings, 0 replies; 15+ messages in thread
From: Brian Foster @ 2021-04-29 13:30 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: guaneryu, linux-xfs, fstests, guan

On Wed, Apr 28, 2021 at 06:31:54PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Prior to lazysbcount, the xfs mount code blindly trusted the value of
> the fdblocks counter in the primary super, which means that the kernel
> doesn't detect the fuzzed fdblocks value at all.  V4 is deprecated and
> pre-lazysbcount V4 hasn't been the default for ~14 years, so we'll just
> skip these two tests on those old filesystems.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
> v1.2: factor the feature checking into a separate helper
> ---

Looks good, thanks for the update:

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  common/xfs    |   12 ++++++++++++
>  tests/xfs/491 |    4 ++++
>  tests/xfs/492 |    4 ++++
>  3 files changed, 20 insertions(+)
> 
> diff --git a/common/xfs b/common/xfs
> index 8501b084..92383061 100644
> --- a/common/xfs
> +++ b/common/xfs
> @@ -1129,6 +1129,18 @@ _check_scratch_xfs_features()
>  	test "${found}" -eq "$#"
>  }
>  
> +# Skip a test if any of the given fs features aren't present on the scratch
> +# filesystem.  The scratch fs must have been formatted already.
> +_require_scratch_xfs_features()
> +{
> +	local features="$(_scratch_xfs_db -c 'version' 2>/dev/null)"
> +
> +	for feature in "$@"; do
> +		echo "${features}" | grep -q -w "${feature}" ||
> +			_notrun "Missing scratch feature: ${feature}"
> +	done
> +}
> +
>  # Decide if xfs_repair knows how to set (or clear) a filesystem feature.
>  _require_xfs_repair_upgrade()
>  {
> diff --git a/tests/xfs/491 b/tests/xfs/491
> index 6420202b..7d447ccf 100755
> --- a/tests/xfs/491
> +++ b/tests/xfs/491
> @@ -36,6 +36,10 @@ _require_scratch
>  
>  echo "Format and mount"
>  _scratch_mkfs > $seqres.full 2>&1
> +
> +# pre-lazysbcount filesystems blindly trust the primary sb fdblocks
> +_require_scratch_xfs_features LAZYSBCOUNT
> +
>  _scratch_mount >> $seqres.full 2>&1
>  echo "test file" > $SCRATCH_MNT/testfile
>  
> diff --git a/tests/xfs/492 b/tests/xfs/492
> index 522def47..21c6872f 100755
> --- a/tests/xfs/492
> +++ b/tests/xfs/492
> @@ -36,6 +36,10 @@ _require_scratch
>  
>  echo "Format and mount"
>  _scratch_mkfs > $seqres.full 2>&1
> +
> +# pre-lazysbcount filesystems blindly trust the primary sb fdblocks
> +_require_scratch_xfs_features LAZYSBCOUNT
> +
>  _scratch_mount >> $seqres.full 2>&1
>  echo "test file" > $SCRATCH_MNT/testfile
>  
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-04-29 13:30 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-28  4:08 [PATCHSET 0/5] fstests: miscellaneous fixes Darrick J. Wong
2021-04-28  4:09 ` [PATCH 1/5] xfs/276: remove unnecessary mkfs golden output Darrick J. Wong
2021-04-28 17:47   ` Brian Foster
2021-04-28  4:09 ` [PATCH 2/5] generic/{094,225}: fix argument to _require_file_block_size_equals_fs_block_size Darrick J. Wong
2021-04-28 17:47   ` Brian Foster
2021-04-28  4:09 ` [PATCH 3/5] generic/449: always fill up the data device Darrick J. Wong
2021-04-28 17:47   ` Brian Foster
2021-04-29  0:39     ` Darrick J. Wong
2021-04-28  4:09 ` [PATCH 4/5] xfs/004: don't fail test due to realtime files Darrick J. Wong
2021-04-28 17:47   ` Brian Foster
2021-04-28  4:09 ` [PATCH 5/5] xfs/49[12]: skip pre-lazysbcount filesystems Darrick J. Wong
2021-04-28 17:47   ` Brian Foster
2021-04-29  0:44     ` Darrick J. Wong
2021-04-29  1:31   ` [PATCH v1.2 " Darrick J. Wong
2021-04-29 13:30     ` Brian Foster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).