linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET v23.1 0/3] fstests: random fixes for v2022.09.25
@ 2022-09-28  4:23 Darrick J. Wong
  2022-09-28  4:23 ` [PATCH 1/3] generic/092: skip test if file allocation unit isn't aligned Darrick J. Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Darrick J. Wong @ 2022-09-28  4:23 UTC (permalink / raw)
  To: djwong, guaneryu, zlang; +Cc: linux-xfs, fstests, guan

Hi all,

Here's the usual batch of odd fixes for fstests.

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/xfs        |    3 +++
 tests/generic/092 |    6 ++++++
 tests/xfs/114     |    2 ++
 tests/xfs/229     |    7 ++++++-
 4 files changed, 17 insertions(+), 1 deletion(-)


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

* [PATCH 1/3] generic/092: skip test if file allocation unit isn't aligned
  2022-09-28  4:23 [PATCHSET v23.1 0/3] fstests: random fixes for v2022.09.25 Darrick J. Wong
@ 2022-09-28  4:23 ` Darrick J. Wong
  2022-09-28 10:04   ` Zorro Lang
  2022-09-28  4:24 ` [PATCH 2/3] xfs/114: fix missing reflink requires Darrick J. Wong
  2022-09-28  4:24 ` [PATCH 3/3] xfs/229: do not _xfs_force_bdev on TEST_DIR Darrick J. Wong
  2 siblings, 1 reply; 7+ messages in thread
From: Darrick J. Wong @ 2022-09-28  4:23 UTC (permalink / raw)
  To: djwong, guaneryu, zlang; +Cc: linux-xfs, fstests, guan

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

This test exercises allocation behavior when truncating a preallocated
file down to 5M and then up to 7M.  If those two sizes aren't aligned
with the file allocation unit length, then the FIEMAP output will show
blocks beyond EOF.  That will cause trouble with the golden output, so
skip this test if that will be the case.

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


diff --git a/tests/generic/092 b/tests/generic/092
index 505e0ec84f..d7c93ca792 100755
--- a/tests/generic/092
+++ b/tests/generic/092
@@ -28,6 +28,12 @@ _require_test
 _require_xfs_io_command "falloc"
 _require_xfs_io_command "fiemap"
 
+# If the truncation sizes (5M/7M) aren't aligned with the file allocation unit
+# length, then the FIEMAP output will show blocks beyond EOF.  That will cause
+# trouble with the golden output, so skip this test if that will be the case.
+_require_congruent_file_oplen $TEST_DIR $((5 * 1048576))
+_require_congruent_file_oplen $TEST_DIR $((7 * 1048576))
+
 # First test to make sure that truncating at i_size trims the preallocated bit
 # past i_size
 $XFS_IO_PROG -f -c "falloc -k 0 10M" -c "pwrite 0 5M" -c "truncate 5M"\


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

* [PATCH 2/3] xfs/114: fix missing reflink requires
  2022-09-28  4:23 [PATCHSET v23.1 0/3] fstests: random fixes for v2022.09.25 Darrick J. Wong
  2022-09-28  4:23 ` [PATCH 1/3] generic/092: skip test if file allocation unit isn't aligned Darrick J. Wong
@ 2022-09-28  4:24 ` Darrick J. Wong
  2022-09-28 10:06   ` Zorro Lang
  2022-09-28  4:24 ` [PATCH 3/3] xfs/229: do not _xfs_force_bdev on TEST_DIR Darrick J. Wong
  2 siblings, 1 reply; 7+ messages in thread
From: Darrick J. Wong @ 2022-09-28  4:24 UTC (permalink / raw)
  To: djwong, guaneryu, zlang; +Cc: linux-xfs, fstests, guan

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

This test both requires cp --reflink and the scratch filesystem to
support reflink.  Add the missing _requires calls.

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


diff --git a/tests/xfs/114 b/tests/xfs/114
index 3aec814a5d..858dc3998e 100755
--- a/tests/xfs/114
+++ b/tests/xfs/114
@@ -18,6 +18,8 @@ _begin_fstest auto quick clone rmap collapse insert
 # real QA test starts here
 _supported_fs xfs
 _require_test_program "punch-alternating"
+_require_cp_reflink
+_require_scratch_reflink
 _require_xfs_scratch_rmapbt
 _require_xfs_io_command "falloc"
 _require_xfs_io_command "fcollapse"


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

* [PATCH 3/3] xfs/229: do not _xfs_force_bdev on TEST_DIR
  2022-09-28  4:23 [PATCHSET v23.1 0/3] fstests: random fixes for v2022.09.25 Darrick J. Wong
  2022-09-28  4:23 ` [PATCH 1/3] generic/092: skip test if file allocation unit isn't aligned Darrick J. Wong
  2022-09-28  4:24 ` [PATCH 2/3] xfs/114: fix missing reflink requires Darrick J. Wong
@ 2022-09-28  4:24 ` Darrick J. Wong
  2022-09-28 10:12   ` Zorro Lang
  2 siblings, 1 reply; 7+ messages in thread
From: Darrick J. Wong @ 2022-09-28  4:24 UTC (permalink / raw)
  To: djwong, guaneryu, zlang; +Cc: linux-xfs, fstests, guan

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

In commit ea15099b71, I observed that this test tries to test the
behavior of the extent size hint on the data device.  If the test runner
set up MKFS_OPTIONS such that the filesystem gets created with a
realtime section and rtinherit set on the root directory, then the
preconditions of this test (creating files on the data section) is not
satisfied and the results of this test are incorrect.  The solution was
to force all files created by this test to be assigned to the data
section.

Unfortunately, the correction that I made has side effects beyond this
test -- by clearing rtinherit on $TEST_DIR, all tests that run after
this one will create files on the data section, because the test
filesystem persists for the duration of the entire test run.  This leads
to the wrong things being tested.

Fix this new problem by clearing the rtinherit flag on $TDIR, which
contains the files created by this test and is removed during cleanup,
and leave a few comments celebrating our new discoveries.

Fixes: ea15099b71 ("xfs: force file creation to the data device for certain layout tests")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 common/xfs    |    3 +++
 tests/xfs/229 |    7 ++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)


diff --git a/common/xfs b/common/xfs
index 170dd621a1..e1c15d3d04 100644
--- a/common/xfs
+++ b/common/xfs
@@ -201,6 +201,9 @@ _xfs_get_file_block_size()
 # For each directory, each file subsequently created will target the given
 # device for file data allocations.  For each empty regular file, each
 # subsequent file data allocation will be on the given device.
+#
+# NOTE: If you call this on $TEST_DIR, you must reset the rtinherit flag state
+# before the end of the test to avoid polluting subsequent tests.
 _xfs_force_bdev()
 {
 	local device="$1"
diff --git a/tests/xfs/229 b/tests/xfs/229
index 2221b9c49c..a58fd16bba 100755
--- a/tests/xfs/229
+++ b/tests/xfs/229
@@ -31,11 +31,16 @@ _require_fs_space $TEST_DIR 3200000
 TDIR="${TEST_DIR}/t_holes"
 NFILES="10"
 EXTSIZE="256k"
-_xfs_force_bdev data $TEST_DIR
 
 # Create the test directory
 mkdir ${TDIR}
 
+# Per-directory extent size hints aren't particularly useful for files that
+# are created on the realtime section.  Force the test file to be created on
+# the data directory.  Do not change the rtinherit flag on $TEST_DIR because
+# that will affect other tests.
+_xfs_force_bdev data $TDIR
+
 # Set the test directory extsize
 $XFS_IO_PROG -c "extsize ${EXTSIZE}" ${TDIR}
 


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

* Re: [PATCH 1/3] generic/092: skip test if file allocation unit isn't aligned
  2022-09-28  4:23 ` [PATCH 1/3] generic/092: skip test if file allocation unit isn't aligned Darrick J. Wong
@ 2022-09-28 10:04   ` Zorro Lang
  0 siblings, 0 replies; 7+ messages in thread
From: Zorro Lang @ 2022-09-28 10:04 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: guaneryu, linux-xfs, fstests, guan

On Tue, Sep 27, 2022 at 09:23:56PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> This test exercises allocation behavior when truncating a preallocated
> file down to 5M and then up to 7M.  If those two sizes aren't aligned
> with the file allocation unit length, then the FIEMAP output will show
> blocks beyond EOF.  That will cause trouble with the golden output, so
> skip this test if that will be the case.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  tests/generic/092 |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> 
> diff --git a/tests/generic/092 b/tests/generic/092
> index 505e0ec84f..d7c93ca792 100755
> --- a/tests/generic/092
> +++ b/tests/generic/092
> @@ -28,6 +28,12 @@ _require_test
>  _require_xfs_io_command "falloc"
>  _require_xfs_io_command "fiemap"
>  
> +# If the truncation sizes (5M/7M) aren't aligned with the file allocation unit
> +# length, then the FIEMAP output will show blocks beyond EOF.  That will cause
> +# trouble with the golden output, so skip this test if that will be the case.
> +_require_congruent_file_oplen $TEST_DIR $((5 * 1048576))
> +_require_congruent_file_oplen $TEST_DIR $((7 * 1048576))

Make sense to me,

Reviewed-by: Zorro Lang <zlang@redhat.com>

> +
>  # First test to make sure that truncating at i_size trims the preallocated bit
>  # past i_size
>  $XFS_IO_PROG -f -c "falloc -k 0 10M" -c "pwrite 0 5M" -c "truncate 5M"\
> 


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

* Re: [PATCH 2/3] xfs/114: fix missing reflink requires
  2022-09-28  4:24 ` [PATCH 2/3] xfs/114: fix missing reflink requires Darrick J. Wong
@ 2022-09-28 10:06   ` Zorro Lang
  0 siblings, 0 replies; 7+ messages in thread
From: Zorro Lang @ 2022-09-28 10:06 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: guaneryu, linux-xfs, fstests, guan

On Tue, Sep 27, 2022 at 09:24:02PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> This test both requires cp --reflink and the scratch filesystem to
> support reflink.  Add the missing _requires calls.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  tests/xfs/114 |    2 ++
>  1 file changed, 2 insertions(+)
> 
> 
> diff --git a/tests/xfs/114 b/tests/xfs/114
> index 3aec814a5d..858dc3998e 100755
> --- a/tests/xfs/114
> +++ b/tests/xfs/114
> @@ -18,6 +18,8 @@ _begin_fstest auto quick clone rmap collapse insert
>  # real QA test starts here
>  _supported_fs xfs
>  _require_test_program "punch-alternating"
> +_require_cp_reflink
> +_require_scratch_reflink

Good to me,

Reviewed-by: Zorro Lang <zlang@redhat.com>

>  _require_xfs_scratch_rmapbt
>  _require_xfs_io_command "falloc"
>  _require_xfs_io_command "fcollapse"
> 


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

* Re: [PATCH 3/3] xfs/229: do not _xfs_force_bdev on TEST_DIR
  2022-09-28  4:24 ` [PATCH 3/3] xfs/229: do not _xfs_force_bdev on TEST_DIR Darrick J. Wong
@ 2022-09-28 10:12   ` Zorro Lang
  0 siblings, 0 replies; 7+ messages in thread
From: Zorro Lang @ 2022-09-28 10:12 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: guaneryu, linux-xfs, fstests, guan

On Tue, Sep 27, 2022 at 09:24:08PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> In commit ea15099b71, I observed that this test tries to test the
> behavior of the extent size hint on the data device.  If the test runner
> set up MKFS_OPTIONS such that the filesystem gets created with a
> realtime section and rtinherit set on the root directory, then the
> preconditions of this test (creating files on the data section) is not
> satisfied and the results of this test are incorrect.  The solution was
> to force all files created by this test to be assigned to the data
> section.
> 
> Unfortunately, the correction that I made has side effects beyond this
> test -- by clearing rtinherit on $TEST_DIR, all tests that run after
> this one will create files on the data section, because the test
> filesystem persists for the duration of the entire test run.  This leads
> to the wrong things being tested.
> 
> Fix this new problem by clearing the rtinherit flag on $TDIR, which
> contains the files created by this test and is removed during cleanup,
> and leave a few comments celebrating our new discoveries.
> 
> Fixes: ea15099b71 ("xfs: force file creation to the data device for certain layout tests")
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---

OK, good news is most of _xfs_force_bdev run on SCRATCH_MNT, only this x/229 run
on TEST_DIR. Better to not change TEST_DIR directly, to avoid it affect later
testing. Thanks for fix it.

Reviewed-by: Zorro Lang <zlang@redhat.com>

Thanks,
Zorro

>  common/xfs    |    3 +++
>  tests/xfs/229 |    7 ++++++-
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> 
> diff --git a/common/xfs b/common/xfs
> index 170dd621a1..e1c15d3d04 100644
> --- a/common/xfs
> +++ b/common/xfs
> @@ -201,6 +201,9 @@ _xfs_get_file_block_size()
>  # For each directory, each file subsequently created will target the given
>  # device for file data allocations.  For each empty regular file, each
>  # subsequent file data allocation will be on the given device.
> +#
> +# NOTE: If you call this on $TEST_DIR, you must reset the rtinherit flag state
> +# before the end of the test to avoid polluting subsequent tests.
>  _xfs_force_bdev()
>  {
>  	local device="$1"
> diff --git a/tests/xfs/229 b/tests/xfs/229
> index 2221b9c49c..a58fd16bba 100755
> --- a/tests/xfs/229
> +++ b/tests/xfs/229
> @@ -31,11 +31,16 @@ _require_fs_space $TEST_DIR 3200000
>  TDIR="${TEST_DIR}/t_holes"
>  NFILES="10"
>  EXTSIZE="256k"
> -_xfs_force_bdev data $TEST_DIR
>  
>  # Create the test directory
>  mkdir ${TDIR}
>  
> +# Per-directory extent size hints aren't particularly useful for files that
> +# are created on the realtime section.  Force the test file to be created on
> +# the data directory.  Do not change the rtinherit flag on $TEST_DIR because
> +# that will affect other tests.
> +_xfs_force_bdev data $TDIR
> +
>  # Set the test directory extsize
>  $XFS_IO_PROG -c "extsize ${EXTSIZE}" ${TDIR}
>  
> 


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

end of thread, other threads:[~2022-09-28 10:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-28  4:23 [PATCHSET v23.1 0/3] fstests: random fixes for v2022.09.25 Darrick J. Wong
2022-09-28  4:23 ` [PATCH 1/3] generic/092: skip test if file allocation unit isn't aligned Darrick J. Wong
2022-09-28 10:04   ` Zorro Lang
2022-09-28  4:24 ` [PATCH 2/3] xfs/114: fix missing reflink requires Darrick J. Wong
2022-09-28 10:06   ` Zorro Lang
2022-09-28  4:24 ` [PATCH 3/3] xfs/229: do not _xfs_force_bdev on TEST_DIR Darrick J. Wong
2022-09-28 10:12   ` Zorro Lang

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).