[PATCH 17/33] ext4/045: don't run the long dirent test on fuse2fs

Darrick J. Wong
2025-10-29T01:24:52Z

fuse2fs doesn't create htree indices for directories because libext2fs
doesn't support creating them. When testing the kernel driver this test
runs in a few seconds, but on fuse2fs it takes ten minutes to create the
small directory with minimally sized names, and three hours more to
create a very large directory with long names.

This is silly for a test that really just wants to make sure that we can
create a directory with a lot of child subdirectories. Skip the long
test on fuse2fs. We probably don't even need the long test.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
tests/ext4/045 | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tests/ext4/045 b/tests/ext4/045
index 15b2541ee342fa..1ccb33dc361682 100755
--- a/tests/ext4/045
+++ b/tests/ext4/045
@@ -84,10 +84,18 @@ workout()

# main
DIR_NUM=65537
-DIR_LEN=( $SHORT_DIR $LONG_DIR )
+DIR_LEN=( $SHORT_DIR )
+# fuse2fs doesn't actually write htree indices to large directories, which
+# means this test becomes excruciatingly slow when the dirent names are long.
+# Skip the test to reduce the runtime from ~3.5h to about 15 minutes.
+if [[ ! "$FSTYP" =~ fuse* ]]; then
+ DIR_LEN+=( $LONG_DIR )
+fi
PARENT_DIR="$SCRATCH_MNT/subdir"

-for ((i = 0; i < 2; i++)); do
+echo "${DIR_LEN[*]}" >> $seqres.full
+
+for ((i = 0; i < ${#DIR_LEN[@]}; i++)); do
workout $DIR_NUM ${DIR_LEN[$i]} $PARENT_DIR
done