shithub: lwext4

Download patch

ref: ff9c19c3d8d2774746827b65242e3fe78943e613
parent: dce5c9e6e964dcf0f56d5c437ae52aacd9ebcb37
author: gkostka <kostka.grzegorz@gmail.com>
date: Fri Oct 24 21:05:45 EDT 2014

Add more test cases

--- a/fs_test.mk
+++ b/fs_test.mk
@@ -581,6 +581,51 @@
 	$(LWEXT4_CLIENT) -c "dir_rm $(TEST_DIR)"
 	$(LWEXT4_CLIENT) -c "stats_check /"
 	$(LWEXT4_CLIENT) -c "umount /"	
+	
+t27:
+	@echo "T27: 10000 entries (dir) dir recursive remove:"
+	$(LWEXT4_CLIENT) -c "device_register 0 0 bdev"
+	$(LWEXT4_CLIENT) -c "mount bdev /"
+	$(LWEXT4_CLIENT) -c "stats_save /"
+	$(LWEXT4_CLIENT) -c "dir_mk $(TEST_DIR)"
+	
+	$(LWEXT4_CLIENT) -c "multi_dcreate $(TEST_DIR) /d 10000"
+	$(LWEXT4_CLIENT) -c "dir_open 0 $(TEST_DIR)"
+	$(LWEXT4_CLIENT) -c "dir_close 0"
+	
+	$(LWEXT4_CLIENT) -c "dir_rm $(TEST_DIR)"
+	$(LWEXT4_CLIENT) -c "stats_check /"
+	$(LWEXT4_CLIENT) -c "umount /"	
+	
+t28:
+	@echo "T28: 50000 entries (dir) dir recursive remove:"
+	$(LWEXT4_CLIENT) -c "device_register 0 0 bdev"
+	$(LWEXT4_CLIENT) -c "mount bdev /"
+	$(LWEXT4_CLIENT) -c "stats_save /"
+	$(LWEXT4_CLIENT) -c "dir_mk $(TEST_DIR)"
+	
+	$(LWEXT4_CLIENT) -c "multi_dcreate $(TEST_DIR) /d 50000"
+	$(LWEXT4_CLIENT) -c "dir_open 0 $(TEST_DIR)"
+	$(LWEXT4_CLIENT) -c "dir_close 0"
+	
+	$(LWEXT4_CLIENT) -c "dir_rm $(TEST_DIR)"
+	$(LWEXT4_CLIENT) -c "stats_check /"
+	$(LWEXT4_CLIENT) -c "umount /"	
+	
+t29:
+	@echo "T29: 250000 entries (dir) dir recursive remove:"
+	$(LWEXT4_CLIENT) -c "device_register 0 0 bdev"
+	$(LWEXT4_CLIENT) -c "mount bdev /"
+	$(LWEXT4_CLIENT) -c "stats_save /"
+	$(LWEXT4_CLIENT) -c "dir_mk $(TEST_DIR)"
+	
+	$(LWEXT4_CLIENT) -c "multi_dcreate $(TEST_DIR) /d 250000"
+	$(LWEXT4_CLIENT) -c "dir_open 0 $(TEST_DIR)"
+	$(LWEXT4_CLIENT) -c "dir_close 0"
+	
+	$(LWEXT4_CLIENT) -c "dir_rm $(TEST_DIR)"
+	$(LWEXT4_CLIENT) -c "stats_check /"
+	$(LWEXT4_CLIENT) -c "umount /"	
 
 ct:
 	@echo "Clean test directory"
@@ -605,4 +650,4 @@
 
 test: t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20
 
-test_more: t21 t22 t23 t24 t25 t26
\ No newline at end of file
+test_more: t21 t22 t23 t24 t25 t26 t27 t28 t29
\ No newline at end of file
--- a/lwext4/ext4.c
+++ b/lwext4/ext4.c
@@ -258,7 +258,7 @@
 
     /* If directory - handle links from parent */
     if (is_dir) {
-        ext4_assert(ext4_inode_get_links_count(child_inode_ref->inode) == 1);
+        //ext4_assert(ext4_inode_get_links_count(child_inode_ref->inode) == 1);
         ext4_fs_inode_links_count_dec(parent);
         parent->dirty = true;
     }