new file mode 100755
@@ -0,0 +1,13 @@
+#!/bin/bash
+echo "feature large_dir"
+echo "mkdir /foo"
+echo "cd /foo"
+touch foofile
+echo "write foofile foofile"
+for i in $(seq 47300); do
+ [[ $(( $i % 5000 )) -eq 0 ]] && \
+ >&2 echo "$i processed"
+ new_uuid=`printf %0255X $i`
+ echo "ln foofile $new_uuid"
+done
+
new file mode 100644
@@ -0,0 +1,10 @@
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 3A: Optimizing directories
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+
+test.img: ***** FILE SYSTEM WAS MODIFIED *****
+test.img: 13/115368 files (0.0% non-contiguous), 32839/460800 blocks
+Exit status is 1
new file mode 100644
@@ -0,0 +1 @@
+optimize 3 level htree directories
new file mode 100644
@@ -0,0 +1,28 @@
+OUT=$test_name.log
+EXP=$test_dir/expect
+DFSCRIPT=$test_dir/debugfs_script
+E2FSCK=../e2fsck/e2fsck
+
+TMPFILE2=/tmp/image
+cp /dev/null $OUT
+$MKE2FS -b 1024 -O large_dir,uninit_bg,dir_nlink -F $TMPFILE2 460800
> /dev/null
+$DFSCRIPT | $DEBUGFS -w -f /dev/stdin $TMPFILE2 > /dev/null
+
+$E2FSCK -yfD $TMPFILE2 > $OUT.new 2>&1
+status=$?
+echo Exit status is $status >> $OUT.new
+sed -f $cmd_dir/filter.sed -e "s;$TMPFILE2;test.img;" $OUT.new >> $OUT
+rm -f $OUT.new
+
+cmp -s $OUT $EXP
+RC=$?
+if [ $RC -eq 0 ]; then
+ echo "$test_name: $test_description: ok"
+ touch $test_name.ok
+else
+ echo "$test_name: $test_description: failed"
+ diff -u $EXP $OUT > $test_name.failed
+fi
+
+
Test is added that recreate directory (-fD fsck option) with 47.5k of 255-symbol name files. This amount of files can not be stored only in 2 hevel htree, so 3 levels are used. Signed-off-by: Artem Blagodarenko <artem.blagodarenko@seagate.com> --- tests/f_large_dir/debugfs_script | 13 +++++++++++++ tests/f_large_dir/expect | 10 ++++++++++ tests/f_large_dir/name | 1 + tests/f_large_dir/script | 28 ++++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 0 deletions(-) create mode 100755 tests/f_large_dir/debugfs_script create mode 100644 tests/f_large_dir/expect create mode 100644 tests/f_large_dir/name create mode 100644 tests/f_large_dir/script + --