[PATCH 07/33] populate: don't check for htree directories on fuse.ext4

Darrick J. Wong
2025-10-29T01:22:16Z

libext2fs doesn't know how to create the htree indexes for a directory,
so fuse2fs doesn't either. Amend common/populate not to check for
htree.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
common/ext4 | 12 ++++++++++++
common/populate | 1 +
tests/ext4/052 | 3 +--
3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/common/ext4 b/common/ext4
index a2ce456d4ec761..69fcbc188dd066 100644
--- a/common/ext4
+++ b/common/ext4
@@ -242,3 +242,15 @@ _ext4_get_inum_iflags() {
debugfs -R "stat <${inumber}>" "${dev}" 2> /dev/null | \
sed -n 's/^.*Flags: \([0-9a-fx]*\).*$/\1/p'
}
+
+_ext4_supports_htree() {
+ # fuse2fs doesn't create htree indexes, ever
+ case "$FSTYP" in
+ fuse.ext[234]|ext2|ext3)
+ return 1
+ ;;
+ *)
+ return 0
+ ;;
+ esac
+}
diff --git a/common/populate b/common/populate
index 6ca4a68b129806..fea2ff167167ae 100644
--- a/common/populate
+++ b/common/populate
@@ -942,6 +942,7 @@ __populate_check_ext4_dir() {
(test "${inline}" -eq 0 && test "${htree}" -eq 0) || __populate_fail "failed to create ${dtype} dir ino ${inode} htree ${htree} inline ${inline}"
;;
"htree")
+ _ext4_supports_htree || return 0
(test "${inline}" -eq 0 && test "${htree}" -eq 1) || __populate_fail "failed to create ${dtype} dir ino ${inode} htree ${htree} inline ${inline}"
;;
*)
diff --git a/tests/ext4/052 b/tests/ext4/052
index 18b2599f43c7ba..05dd30edf70c9b 100755
--- a/tests/ext4/052
+++ b/tests/ext4/052
@@ -29,8 +29,7 @@ _cleanup()

# Modify as appropriate.
-_exclude_fs ext2
-_exclude_fs ext3
+_ext4_supports_htree || _notrun "htree not supported on $FSTYP"
_require_test
_require_loop
_require_test_program "dirstress"