FSTests Archive on lore.kernel.org
 help / color / Atom feed
* [PATCHSET 0/2] fstests: random fixes
@ 2021-04-21  0:22 Darrick J. Wong
  2021-04-21  0:22 ` [PATCH 1/2] generic/223: make sure all files get created on the data device Darrick J. Wong
  2021-04-21  0:22 ` [PATCH 2/2] common/dmthin: make this work with external log devices Darrick J. Wong
  0 siblings, 2 replies; 7+ messages in thread
From: Darrick J. Wong @ 2021-04-21  0:22 UTC (permalink / raw)
  To: djwong, guaneryu; +Cc: linux-xfs, fstests, guan

Hi all,

This branch contains fixes to various tests to fix miscellaneous test
bugs and unnecessary regressions when XFS is configured with somewhat
unusual configurations (e.g. external logs, and realtime devices).

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/dmthin     |    9 ++++++++-
 tests/generic/223 |    5 +++++
 tests/generic/347 |    2 +-
 tests/generic/500 |    2 +-
 4 files changed, 15 insertions(+), 3 deletions(-)


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

* [PATCH 1/2] generic/223: make sure all files get created on the data device
  2021-04-21  0:22 [PATCHSET 0/2] fstests: random fixes Darrick J. Wong
@ 2021-04-21  0:22 ` Darrick J. Wong
  2021-04-21 17:26   ` Brian Foster
  2021-04-22  0:29   ` Allison Henderson
  2021-04-21  0:22 ` [PATCH 2/2] common/dmthin: make this work with external log devices Darrick J. Wong
  1 sibling, 2 replies; 7+ messages in thread
From: Darrick J. Wong @ 2021-04-21  0:22 UTC (permalink / raw)
  To: djwong, guaneryu; +Cc: linux-xfs, fstests, guan

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

This test formats filesystems with various stripe alignments, then
checks that data file allocations are actually aligned to those stripe
geometries.  If this test is run on an XFS filesystem with a realtime
volume and RTINHERIT is set on the root dir, the test will fail because
all new files will be created as realtime files, and realtime
allocations are not subject to data device stripe alignments.  Fix this
by clearing rtinherit on the root dir.

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


diff --git a/tests/generic/223 b/tests/generic/223
index 1f85efe5..f6393293 100755
--- a/tests/generic/223
+++ b/tests/generic/223
@@ -43,6 +43,11 @@ for SUNIT_K in 8 16 32 64 128; do
 	_scratch_mkfs_geom $SUNIT_BYTES 4 $BLOCKSIZE >> $seqres.full 2>&1
 	_scratch_mount
 
+	# This test checks for stripe alignments of space allocations on the
+	# filesystem.  Make sure all files get created on the main device,
+	# which for XFS means no rt files.
+	test "$FSTYP" = "xfs" && $XFS_IO_PROG -c 'chattr -t' $SCRATCH_MNT
+
 	for SIZE_MULT in 1 2 8 64 256; do
 		let SIZE=$SIZE_MULT*$SUNIT_BYTES
 


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

* [PATCH 2/2] common/dmthin: make this work with external log devices
  2021-04-21  0:22 [PATCHSET 0/2] fstests: random fixes Darrick J. Wong
  2021-04-21  0:22 ` [PATCH 1/2] generic/223: make sure all files get created on the data device Darrick J. Wong
@ 2021-04-21  0:22 ` Darrick J. Wong
  2021-04-21 17:26   ` Brian Foster
  2021-04-22  0:29   ` Allison Henderson
  1 sibling, 2 replies; 7+ messages in thread
From: Darrick J. Wong @ 2021-04-21  0:22 UTC (permalink / raw)
  To: djwong, guaneryu; +Cc: linux-xfs, fstests, guan

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

Provide a mkfs helper to format the dm thin device when external devices
are in use, and fix the dmthin mount helper to support them.  This fixes
regressions in generic/347 and generic/500 when external logs are in
use.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 common/dmthin     |    9 ++++++++-
 tests/generic/347 |    2 +-
 tests/generic/500 |    2 +-
 3 files changed, 10 insertions(+), 3 deletions(-)


diff --git a/common/dmthin b/common/dmthin
index c58c3948..3b1c7d45 100644
--- a/common/dmthin
+++ b/common/dmthin
@@ -218,10 +218,17 @@ _dmthin_set_fail()
 
 _dmthin_mount_options()
 {
-	echo `_common_dev_mount_options $*` $DMTHIN_VOL_DEV $SCRATCH_MNT
+	_scratch_options mount
+	echo `_common_dev_mount_options $*` $SCRATCH_OPTIONS $DMTHIN_VOL_DEV $SCRATCH_MNT
 }
 
 _dmthin_mount()
 {
 	_mount -t $FSTYP `_dmthin_mount_options $*`
 }
+
+_dmthin_mkfs()
+{
+	_scratch_options mkfs
+	_mkfs_dev $SCRATCH_OPTIONS $@ $DMTHIN_VOL_DEV
+}
diff --git a/tests/generic/347 b/tests/generic/347
index cbc5150a..e970ac10 100755
--- a/tests/generic/347
+++ b/tests/generic/347
@@ -31,7 +31,7 @@ _setup_thin()
 {
 	_dmthin_init $BACKING_SIZE $VIRTUAL_SIZE
 	_dmthin_set_queue
-	_mkfs_dev $DMTHIN_VOL_DEV
+	_dmthin_mkfs
 	_dmthin_mount
 }
 
diff --git a/tests/generic/500 b/tests/generic/500
index 085ddbf3..5ab2f78c 100755
--- a/tests/generic/500
+++ b/tests/generic/500
@@ -68,7 +68,7 @@ CLUSTER_SIZE=$((64 * 1024 / 512))		# 64K
 
 _dmthin_init $BACKING_SIZE $VIRTUAL_SIZE $CLUSTER_SIZE 0
 _dmthin_set_fail
-_mkfs_dev $DMTHIN_VOL_DEV
+_dmthin_mkfs
 _dmthin_mount
 
 # There're two bugs at here, one is dm-thin bug, the other is filesystem


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

* Re: [PATCH 1/2] generic/223: make sure all files get created on the data device
  2021-04-21  0:22 ` [PATCH 1/2] generic/223: make sure all files get created on the data device Darrick J. Wong
@ 2021-04-21 17:26   ` Brian Foster
  2021-04-22  0:29   ` Allison Henderson
  1 sibling, 0 replies; 7+ messages in thread
From: Brian Foster @ 2021-04-21 17:26 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: guaneryu, linux-xfs, fstests, guan

On Tue, Apr 20, 2021 at 05:22:25PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> This test formats filesystems with various stripe alignments, then
> checks that data file allocations are actually aligned to those stripe
> geometries.  If this test is run on an XFS filesystem with a realtime
> volume and RTINHERIT is set on the root dir, the test will fail because
> all new files will be created as realtime files, and realtime
> allocations are not subject to data device stripe alignments.  Fix this
> by clearing rtinherit on the root dir.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---

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

>  tests/generic/223 |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> 
> diff --git a/tests/generic/223 b/tests/generic/223
> index 1f85efe5..f6393293 100755
> --- a/tests/generic/223
> +++ b/tests/generic/223
> @@ -43,6 +43,11 @@ for SUNIT_K in 8 16 32 64 128; do
>  	_scratch_mkfs_geom $SUNIT_BYTES 4 $BLOCKSIZE >> $seqres.full 2>&1
>  	_scratch_mount
>  
> +	# This test checks for stripe alignments of space allocations on the
> +	# filesystem.  Make sure all files get created on the main device,
> +	# which for XFS means no rt files.
> +	test "$FSTYP" = "xfs" && $XFS_IO_PROG -c 'chattr -t' $SCRATCH_MNT
> +
>  	for SIZE_MULT in 1 2 8 64 256; do
>  		let SIZE=$SIZE_MULT*$SUNIT_BYTES
>  
> 


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

* Re: [PATCH 2/2] common/dmthin: make this work with external log devices
  2021-04-21  0:22 ` [PATCH 2/2] common/dmthin: make this work with external log devices Darrick J. Wong
@ 2021-04-21 17:26   ` Brian Foster
  2021-04-22  0:29   ` Allison Henderson
  1 sibling, 0 replies; 7+ messages in thread
From: Brian Foster @ 2021-04-21 17:26 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: guaneryu, linux-xfs, fstests, guan

On Tue, Apr 20, 2021 at 05:22:31PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Provide a mkfs helper to format the dm thin device when external devices
> are in use, and fix the dmthin mount helper to support them.  This fixes
> regressions in generic/347 and generic/500 when external logs are in
> use.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---

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

>  common/dmthin     |    9 ++++++++-
>  tests/generic/347 |    2 +-
>  tests/generic/500 |    2 +-
>  3 files changed, 10 insertions(+), 3 deletions(-)
> 
> 
> diff --git a/common/dmthin b/common/dmthin
> index c58c3948..3b1c7d45 100644
> --- a/common/dmthin
> +++ b/common/dmthin
> @@ -218,10 +218,17 @@ _dmthin_set_fail()
>  
>  _dmthin_mount_options()
>  {
> -	echo `_common_dev_mount_options $*` $DMTHIN_VOL_DEV $SCRATCH_MNT
> +	_scratch_options mount
> +	echo `_common_dev_mount_options $*` $SCRATCH_OPTIONS $DMTHIN_VOL_DEV $SCRATCH_MNT
>  }
>  
>  _dmthin_mount()
>  {
>  	_mount -t $FSTYP `_dmthin_mount_options $*`
>  }
> +
> +_dmthin_mkfs()
> +{
> +	_scratch_options mkfs
> +	_mkfs_dev $SCRATCH_OPTIONS $@ $DMTHIN_VOL_DEV
> +}
> diff --git a/tests/generic/347 b/tests/generic/347
> index cbc5150a..e970ac10 100755
> --- a/tests/generic/347
> +++ b/tests/generic/347
> @@ -31,7 +31,7 @@ _setup_thin()
>  {
>  	_dmthin_init $BACKING_SIZE $VIRTUAL_SIZE
>  	_dmthin_set_queue
> -	_mkfs_dev $DMTHIN_VOL_DEV
> +	_dmthin_mkfs
>  	_dmthin_mount
>  }
>  
> diff --git a/tests/generic/500 b/tests/generic/500
> index 085ddbf3..5ab2f78c 100755
> --- a/tests/generic/500
> +++ b/tests/generic/500
> @@ -68,7 +68,7 @@ CLUSTER_SIZE=$((64 * 1024 / 512))		# 64K
>  
>  _dmthin_init $BACKING_SIZE $VIRTUAL_SIZE $CLUSTER_SIZE 0
>  _dmthin_set_fail
> -_mkfs_dev $DMTHIN_VOL_DEV
> +_dmthin_mkfs
>  _dmthin_mount
>  
>  # There're two bugs at here, one is dm-thin bug, the other is filesystem
> 


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

* Re: [PATCH 1/2] generic/223: make sure all files get created on the data device
  2021-04-21  0:22 ` [PATCH 1/2] generic/223: make sure all files get created on the data device Darrick J. Wong
  2021-04-21 17:26   ` Brian Foster
@ 2021-04-22  0:29   ` Allison Henderson
  1 sibling, 0 replies; 7+ messages in thread
From: Allison Henderson @ 2021-04-22  0:29 UTC (permalink / raw)
  To: Darrick J. Wong, guaneryu; +Cc: linux-xfs, fstests, guan



On 4/20/21 5:22 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> This test formats filesystems with various stripe alignments, then
> checks that data file allocations are actually aligned to those stripe
> geometries.  If this test is run on an XFS filesystem with a realtime
> volume and RTINHERIT is set on the root dir, the test will fail because
> all new files will be created as realtime files, and realtime
> allocations are not subject to data device stripe alignments.  Fix this
> by clearing rtinherit on the root dir.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
ok, makes sense

Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
> ---
>   tests/generic/223 |    5 +++++
>   1 file changed, 5 insertions(+)
> 
> 
> diff --git a/tests/generic/223 b/tests/generic/223
> index 1f85efe5..f6393293 100755
> --- a/tests/generic/223
> +++ b/tests/generic/223
> @@ -43,6 +43,11 @@ for SUNIT_K in 8 16 32 64 128; do
>   	_scratch_mkfs_geom $SUNIT_BYTES 4 $BLOCKSIZE >> $seqres.full 2>&1
>   	_scratch_mount
>   
> +	# This test checks for stripe alignments of space allocations on the
> +	# filesystem.  Make sure all files get created on the main device,
> +	# which for XFS means no rt files.
> +	test "$FSTYP" = "xfs" && $XFS_IO_PROG -c 'chattr -t' $SCRATCH_MNT
> +
>   	for SIZE_MULT in 1 2 8 64 256; do
>   		let SIZE=$SIZE_MULT*$SUNIT_BYTES
>   
> 

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

* Re: [PATCH 2/2] common/dmthin: make this work with external log devices
  2021-04-21  0:22 ` [PATCH 2/2] common/dmthin: make this work with external log devices Darrick J. Wong
  2021-04-21 17:26   ` Brian Foster
@ 2021-04-22  0:29   ` Allison Henderson
  1 sibling, 0 replies; 7+ messages in thread
From: Allison Henderson @ 2021-04-22  0:29 UTC (permalink / raw)
  To: Darrick J. Wong, guaneryu; +Cc: linux-xfs, fstests, guan



On 4/20/21 5:22 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Provide a mkfs helper to format the dm thin device when external devices
> are in use, and fix the dmthin mount helper to support them.  This fixes
> regressions in generic/347 and generic/500 when external logs are in
> use.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
ok, looks good
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
> ---
>   common/dmthin     |    9 ++++++++-
>   tests/generic/347 |    2 +-
>   tests/generic/500 |    2 +-
>   3 files changed, 10 insertions(+), 3 deletions(-)
> 
> 
> diff --git a/common/dmthin b/common/dmthin
> index c58c3948..3b1c7d45 100644
> --- a/common/dmthin
> +++ b/common/dmthin
> @@ -218,10 +218,17 @@ _dmthin_set_fail()
>   
>   _dmthin_mount_options()
>   {
> -	echo `_common_dev_mount_options $*` $DMTHIN_VOL_DEV $SCRATCH_MNT
> +	_scratch_options mount
> +	echo `_common_dev_mount_options $*` $SCRATCH_OPTIONS $DMTHIN_VOL_DEV $SCRATCH_MNT
>   }
>   
>   _dmthin_mount()
>   {
>   	_mount -t $FSTYP `_dmthin_mount_options $*`
>   }
> +
> +_dmthin_mkfs()
> +{
> +	_scratch_options mkfs
> +	_mkfs_dev $SCRATCH_OPTIONS $@ $DMTHIN_VOL_DEV
> +}
> diff --git a/tests/generic/347 b/tests/generic/347
> index cbc5150a..e970ac10 100755
> --- a/tests/generic/347
> +++ b/tests/generic/347
> @@ -31,7 +31,7 @@ _setup_thin()
>   {
>   	_dmthin_init $BACKING_SIZE $VIRTUAL_SIZE
>   	_dmthin_set_queue
> -	_mkfs_dev $DMTHIN_VOL_DEV
> +	_dmthin_mkfs
>   	_dmthin_mount
>   }
>   
> diff --git a/tests/generic/500 b/tests/generic/500
> index 085ddbf3..5ab2f78c 100755
> --- a/tests/generic/500
> +++ b/tests/generic/500
> @@ -68,7 +68,7 @@ CLUSTER_SIZE=$((64 * 1024 / 512))		# 64K
>   
>   _dmthin_init $BACKING_SIZE $VIRTUAL_SIZE $CLUSTER_SIZE 0
>   _dmthin_set_fail
> -_mkfs_dev $DMTHIN_VOL_DEV
> +_dmthin_mkfs
>   _dmthin_mount
>   
>   # There're two bugs at here, one is dm-thin bug, the other is filesystem
> 

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

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21  0:22 [PATCHSET 0/2] fstests: random fixes Darrick J. Wong
2021-04-21  0:22 ` [PATCH 1/2] generic/223: make sure all files get created on the data device Darrick J. Wong
2021-04-21 17:26   ` Brian Foster
2021-04-22  0:29   ` Allison Henderson
2021-04-21  0:22 ` [PATCH 2/2] common/dmthin: make this work with external log devices Darrick J. Wong
2021-04-21 17:26   ` Brian Foster
2021-04-22  0:29   ` Allison Henderson

FSTests Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/fstests/0 fstests/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 fstests fstests/ https://lore.kernel.org/fstests \
		fstests@vger.kernel.org
	public-inbox-index fstests

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.fstests


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git