linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfs: skip test that want to mdrestore to block devices on zoned devices
@ 2025-05-13  5:19 Christoph Hellwig
  2025-05-13 14:37 ` Darrick J. Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2025-05-13  5:19 UTC (permalink / raw)
  To: zlang; +Cc: djwong, hans.holmberg, linux-xfs, fstests

mdrestore doesn't work on zoned device, so skip tests using to
pre-populate a file system image.

This was previously papered over by requiring fallocate, which got
removed in commit eff1baf42a79 ("common/populate: drop fallocate mode 0
requirement").

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 common/populate |  2 +-
 common/xfs      | 14 ++++++++++++++
 tests/xfs/284   |  1 +
 tests/xfs/598   |  1 +
 4 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/common/populate b/common/populate
index 50dc75d35259..1c0dd03e4ac7 100644
--- a/common/populate
+++ b/common/populate
@@ -19,7 +19,7 @@ _require_populate_commands() {
 	"xfs")
 		_require_command "$XFS_DB_PROG" "xfs_db"
 		_require_command "$WIPEFS_PROG" "wipefs"
-		_require_command "$XFS_MDRESTORE_PROG" "xfs_mdrestore"
+		_require_scratch_xfs_mdrestore
 		;;
 	ext*)
 		_require_command "$DUMPE2FS_PROG" "dumpe2fs"
diff --git a/common/xfs b/common/xfs
index 96c15f3c7bb0..4ac29a95812b 100644
--- a/common/xfs
+++ b/common/xfs
@@ -772,6 +772,20 @@ _scratch_xfs_mdrestore()
 	_xfs_mdrestore "$metadump" "$SCRATCH_DEV" "$logdev" "$rtdev" "$@"
 }
 
+# Check if mdrestore to the scratch device is supported
+_require_scratch_xfs_mdrestore() {
+	_require_command "$XFS_MDRESTORE_PROG" "xfs_mdrestore"
+
+	# mdrestore can't restore to zoned devices
+        _require_non_zoned_device $SCRATCH_DEV
+	if [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ]; then
+		_require_non_zoned_device $SCRATCH_LOGDEV
+	fi
+	if [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ]; then
+		_require_non_zoned_device $SCRATCH_RTDEV
+	fi
+}
+
 # Do not use xfs_repair (offline fsck) to rebuild the filesystem
 _xfs_skip_offline_rebuild() {
 	touch "$RESULT_DIR/.skip_rebuild"
diff --git a/tests/xfs/284 b/tests/xfs/284
index 91c17690cabe..79bf80842234 100755
--- a/tests/xfs/284
+++ b/tests/xfs/284
@@ -27,6 +27,7 @@ _require_xfs_copy
 _require_test
 _require_scratch
 _require_no_large_scratch_dev
+_require_scratch_xfs_mdrestore
 
 function filter_mounted()
 {
diff --git a/tests/xfs/598 b/tests/xfs/598
index 20a80fcb6b91..82a9a79208ab 100755
--- a/tests/xfs/598
+++ b/tests/xfs/598
@@ -28,6 +28,7 @@ _require_test
 _require_scratch
 _require_xfs_mkfs_ciname
 _require_xfs_ciname
+_require_scratch_xfs_mdrestore
 
 _scratch_mkfs -n version=ci > $seqres.full
 _scratch_mount
-- 
2.47.2


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

* Re: [PATCH] xfs: skip test that want to mdrestore to block devices on zoned devices
  2025-05-13  5:19 [PATCH] xfs: skip test that want to mdrestore to block devices on zoned devices Christoph Hellwig
@ 2025-05-13 14:37 ` Darrick J. Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2025-05-13 14:37 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: zlang, hans.holmberg, linux-xfs, fstests

On Tue, May 13, 2025 at 07:19:33AM +0200, Christoph Hellwig wrote:
> mdrestore doesn't work on zoned device, so skip tests using to
> pre-populate a file system image.
> 
> This was previously papered over by requiring fallocate, which got
> removed in commit eff1baf42a79 ("common/populate: drop fallocate mode 0
> requirement").
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---

Looks good,
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

>  common/populate |  2 +-
>  common/xfs      | 14 ++++++++++++++
>  tests/xfs/284   |  1 +
>  tests/xfs/598   |  1 +
>  4 files changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/common/populate b/common/populate
> index 50dc75d35259..1c0dd03e4ac7 100644
> --- a/common/populate
> +++ b/common/populate
> @@ -19,7 +19,7 @@ _require_populate_commands() {
>  	"xfs")
>  		_require_command "$XFS_DB_PROG" "xfs_db"
>  		_require_command "$WIPEFS_PROG" "wipefs"
> -		_require_command "$XFS_MDRESTORE_PROG" "xfs_mdrestore"
> +		_require_scratch_xfs_mdrestore
>  		;;
>  	ext*)
>  		_require_command "$DUMPE2FS_PROG" "dumpe2fs"
> diff --git a/common/xfs b/common/xfs
> index 96c15f3c7bb0..4ac29a95812b 100644
> --- a/common/xfs
> +++ b/common/xfs
> @@ -772,6 +772,20 @@ _scratch_xfs_mdrestore()
>  	_xfs_mdrestore "$metadump" "$SCRATCH_DEV" "$logdev" "$rtdev" "$@"
>  }
>  
> +# Check if mdrestore to the scratch device is supported
> +_require_scratch_xfs_mdrestore() {
> +	_require_command "$XFS_MDRESTORE_PROG" "xfs_mdrestore"
> +
> +	# mdrestore can't restore to zoned devices
> +        _require_non_zoned_device $SCRATCH_DEV
> +	if [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ]; then
> +		_require_non_zoned_device $SCRATCH_LOGDEV
> +	fi
> +	if [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ]; then
> +		_require_non_zoned_device $SCRATCH_RTDEV
> +	fi
> +}
> +
>  # Do not use xfs_repair (offline fsck) to rebuild the filesystem
>  _xfs_skip_offline_rebuild() {
>  	touch "$RESULT_DIR/.skip_rebuild"
> diff --git a/tests/xfs/284 b/tests/xfs/284
> index 91c17690cabe..79bf80842234 100755
> --- a/tests/xfs/284
> +++ b/tests/xfs/284
> @@ -27,6 +27,7 @@ _require_xfs_copy
>  _require_test
>  _require_scratch
>  _require_no_large_scratch_dev
> +_require_scratch_xfs_mdrestore
>  
>  function filter_mounted()
>  {
> diff --git a/tests/xfs/598 b/tests/xfs/598
> index 20a80fcb6b91..82a9a79208ab 100755
> --- a/tests/xfs/598
> +++ b/tests/xfs/598
> @@ -28,6 +28,7 @@ _require_test
>  _require_scratch
>  _require_xfs_mkfs_ciname
>  _require_xfs_ciname
> +_require_scratch_xfs_mdrestore
>  
>  _scratch_mkfs -n version=ci > $seqres.full
>  _scratch_mount
> -- 
> 2.47.2
> 
> 

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

end of thread, other threads:[~2025-05-13 14:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-13  5:19 [PATCH] xfs: skip test that want to mdrestore to block devices on zoned devices Christoph Hellwig
2025-05-13 14: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;
as well as URLs for NNTP newsgroup(s).