diff mbox series

[-v2,1/2] ext4/045: use the large_dir feature to fix test failures with a 1k block size

Message ID 20240611222659.256476-1-tytso@mit.edu (mailing list archive)
State New, archived
Headers show
Series [-v2,1/2] ext4/045: use the large_dir feature to fix test failures with a 1k block size | expand

Commit Message

Theodore Ts'o June 11, 2024, 10:26 p.m. UTC
If the file system has a 1k blocksize, this test will fail without the
large_dir file system, because the depth of the dir_index tree needs
to be greater than 2.  So enable the large_dir unconditionally, which
also gives us better test coverage of the large_dir code paths.

As a result of requiring large_dir, this test will get skipped if the
kernel is older than 4.13 --- which was released in 2017; and that
seems to be reasonable at this point.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 tests/ext4/045 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Zorro Lang June 17, 2024, 7:26 a.m. UTC | #1
On Tue, Jun 11, 2024 at 06:26:58PM -0400, Theodore Ts'o wrote:
> If the file system has a 1k blocksize, this test will fail without the
> large_dir file system, because the depth of the dir_index tree needs
> to be greater than 2.  So enable the large_dir unconditionally, which
> also gives us better test coverage of the large_dir code paths.
> 
> As a result of requiring large_dir, this test will get skipped if the
> kernel is older than 4.13 --- which was released in 2017; and that
> seems to be reasonable at this point.

Makes sense to me,

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

> 
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> ---
>  tests/ext4/045 | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/ext4/045 b/tests/ext4/045
> index 4f0ad4aa7..a90ae1ba3 100755
> --- a/tests/ext4/045
> +++ b/tests/ext4/045
> @@ -20,6 +20,7 @@ LONG_DIR=2
>  _supported_fs ext4
>  
>  _require_scratch
> +_require_scratch_ext4_feature large_dir
>  _require_test_program "t_create_short_dirs"
>  _require_test_program "t_create_long_dirs"
>  _require_dumpe2fs
> @@ -42,7 +43,7 @@ workout()
>         echo "Num of dirs to create: $1, Dir name len: $dir_name_len, " \
>                 "Parent dir: $3" >> $seqres.full
>  
> -       _scratch_mkfs "-O extent,dir_nlink,dir_index -I 256" >> $seqres.full 2>&1
> +       _scratch_mkfs "-O extent,dir_nlink,dir_index,large_dir -I 256" >> $seqres.full 2>&1




>         _scratch_mount
>  
>         # create directories
> -- 
> 2.43.0
> 
>
diff mbox series

Patch

diff --git a/tests/ext4/045 b/tests/ext4/045
index 4f0ad4aa7..a90ae1ba3 100755
--- a/tests/ext4/045
+++ b/tests/ext4/045
@@ -20,6 +20,7 @@  LONG_DIR=2
 _supported_fs ext4
 
 _require_scratch
+_require_scratch_ext4_feature large_dir
 _require_test_program "t_create_short_dirs"
 _require_test_program "t_create_long_dirs"
 _require_dumpe2fs
@@ -42,7 +43,7 @@  workout()
        echo "Num of dirs to create: $1, Dir name len: $dir_name_len, " \
                "Parent dir: $3" >> $seqres.full
 
-       _scratch_mkfs "-O extent,dir_nlink,dir_index -I 256" >> $seqres.full 2>&1
+       _scratch_mkfs "-O extent,dir_nlink,dir_index,large_dir -I 256" >> $seqres.full 2>&1
        _scratch_mount
 
        # create directories