* [PATCH] ext4/028: require that the scratch file system has the extent feature enabled
@ 2025-07-14 12:51 Theodore Ts'o
2025-07-17 16:37 ` Darrick J. Wong
0 siblings, 1 reply; 2+ messages in thread
From: Theodore Ts'o @ 2025-07-14 12:51 UTC (permalink / raw)
To: fstests; +Cc: Theodore Ts'o
If the file system configuration has journalling enabled, but doesn't
have the extent feature enabled (e.g., when testing the ext3
configuration) the test will fail since _scratch_populate_cached
creates files with extents enabled. So add a check to skip the test
in that case.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
common/ext4 | 23 +++++++++++++++++------
tests/ext4/028 | 1 +
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/common/ext4 b/common/ext4
index f88fa5324..06191e304 100644
--- a/common/ext4
+++ b/common/ext4
@@ -165,15 +165,26 @@ _ext4_mdrestore()
return $res
}
-# this test requires the ext4 kernel support crc feature on scratch device
+# this test requires the ext4 kernel supports a particular feature
+# on the scratch device
#
+_require_scratch_ext4_feature_enabled()
+{
+ if [ -z "$1" ]; then
+ echo "Usage: _require_scratch_ext4_feature feature"
+ _exit 1
+ fi
+ _scratch_mkfs_ext4 >/dev/null 2>&1
+ dumpe2fs -h $SCRATCH_DEV 2> /dev/null | grep -q "$1" || \
+ _notrun "$1 not enabled by this filesystem"
+ _try_scratch_mount >/dev/null 2>&1 \
+ || _notrun "Kernel doesn't support $1 feature"
+ _scratch_unmount
+}
+
_require_scratch_ext4_crc()
{
- _scratch_mkfs_ext4 >/dev/null 2>&1
- dumpe2fs -h $SCRATCH_DEV 2> /dev/null | grep -q metadata_csum || _notrun "metadata_csum not supported by this filesystem"
- _try_scratch_mount >/dev/null 2>&1 \
- || _notrun "Kernel doesn't support metadata_csum feature"
- _scratch_unmount
+ _require_scratch_ext4_feature_enabled "metadata_csum"
}
# Check whether the specified feature whether it is supported by
diff --git a/tests/ext4/028 b/tests/ext4/028
index 1b8855098..254074f08 100755
--- a/tests/ext4/028
+++ b/tests/ext4/028
@@ -24,6 +24,7 @@ _exclude_fs ext2
_exclude_fs ext3
_require_scratch
+_require_scratch_ext4_feature_enabled "extent"
_require_populate_commands
_require_xfs_io_command "fsmap"
--
2.47.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ext4/028: require that the scratch file system has the extent feature enabled
2025-07-14 12:51 [PATCH] ext4/028: require that the scratch file system has the extent feature enabled Theodore Ts'o
@ 2025-07-17 16:37 ` Darrick J. Wong
0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2025-07-17 16:37 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: fstests
On Mon, Jul 14, 2025 at 08:51:54AM -0400, Theodore Ts'o wrote:
> If the file system configuration has journalling enabled, but doesn't
> have the extent feature enabled (e.g., when testing the ext3
> configuration) the test will fail since _scratch_populate_cached
> creates files with extents enabled. So add a check to skip the test
> in that case.
>
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> ---
> common/ext4 | 23 +++++++++++++++++------
> tests/ext4/028 | 1 +
> 2 files changed, 18 insertions(+), 6 deletions(-)
>
> diff --git a/common/ext4 b/common/ext4
> index f88fa5324..06191e304 100644
> --- a/common/ext4
> +++ b/common/ext4
> @@ -165,15 +165,26 @@ _ext4_mdrestore()
> return $res
> }
>
> -# this test requires the ext4 kernel support crc feature on scratch device
> +# this test requires the ext4 kernel supports a particular feature
> +# on the scratch device
> #
> +_require_scratch_ext4_feature_enabled()
> +{
> + if [ -z "$1" ]; then
> + echo "Usage: _require_scratch_ext4_feature feature"
> + _exit 1
> + fi
> + _scratch_mkfs_ext4 >/dev/null 2>&1
> + dumpe2fs -h $SCRATCH_DEV 2> /dev/null | grep -q "$1" || \
This would be a good time to convert this to call $DUMPE2FS_PROG instead
of dumpe2fs directly.
With that fixed,
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> + _notrun "$1 not enabled by this filesystem"
> + _try_scratch_mount >/dev/null 2>&1 \
> + || _notrun "Kernel doesn't support $1 feature"
> + _scratch_unmount
> +}
> +
> _require_scratch_ext4_crc()
> {
> - _scratch_mkfs_ext4 >/dev/null 2>&1
> - dumpe2fs -h $SCRATCH_DEV 2> /dev/null | grep -q metadata_csum || _notrun "metadata_csum not supported by this filesystem"
> - _try_scratch_mount >/dev/null 2>&1 \
> - || _notrun "Kernel doesn't support metadata_csum feature"
> - _scratch_unmount
> + _require_scratch_ext4_feature_enabled "metadata_csum"
> }
>
> # Check whether the specified feature whether it is supported by
> diff --git a/tests/ext4/028 b/tests/ext4/028
> index 1b8855098..254074f08 100755
> --- a/tests/ext4/028
> +++ b/tests/ext4/028
> @@ -24,6 +24,7 @@ _exclude_fs ext2
> _exclude_fs ext3
>
> _require_scratch
> +_require_scratch_ext4_feature_enabled "extent"
> _require_populate_commands
> _require_xfs_io_command "fsmap"
>
> --
> 2.47.2
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-07-17 16:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-14 12:51 [PATCH] ext4/028: require that the scratch file system has the extent feature enabled Theodore Ts'o
2025-07-17 16: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