public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4/048: Fix hangup due to no free inodes
@ 2025-10-28  7:17 Ojaswin Mujoo
  2025-10-28  7:57 ` Baokun Li
  0 siblings, 1 reply; 4+ messages in thread
From: Ojaswin Mujoo @ 2025-10-28  7:17 UTC (permalink / raw)
  To: Zorro Lang, fstests; +Cc: Leah Rumancik, linux-ext4

We currently mkfs a 128MB filesystem, which gives use ~2048 free inodes
on 64k blocksize. The test then keeps adding new files to a directory to
trigger an htree split. For 64k this takes more than the total free
inodes, which causes touch to return -ENOSPC. This leads to the while
loop in induce_node_split() to never finish.

To fix this:
1. Format a 1G FS which gives us atleast 16K inodes to work with.
2. _fail if there's any error while trying to induce node split, so we
   dont get stuck in loop

Fixes: 466ddbfd1151 ("ext4: add test for ext4_dir_entry2 wipe")
Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
---
 tests/ext4/048 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/ext4/048 b/tests/ext4/048
index 2031c8c8..6343ff3a 100755
--- a/tests/ext4/048
+++ b/tests/ext4/048
@@ -69,6 +69,11 @@ induce_node_split() {
 	while [[ "$(stat --printf="%s" $testdir)" == "$dir_size" ]]; do
 		file_num=$(($file_num + 1))
 		touch $testdir/test"$(printf "%04d" $file_num)"
+		local ret=$?
+		if [[ $ret -ne 0 ]]
+		then
+			_fail "ERROR induce_node_split(): $ret"
+		fi
 	done
 	_scratch_unmount >> $seqres.full 2>&1
 }
@@ -81,7 +86,7 @@ test_file1="test0001"
 test_file2="test0002"
 test_file3="test0003"
 
-_scratch_mkfs_sized $((128 * 1024 * 1024)) >> $seqres.full 2>&1
+_scratch_mkfs_sized $((1 * 1024 * 1024 * 1024)) >> $seqres.full 2>&1
 
 # create scratch dir for testing
 # create some files with no name a substr of another name so we can grep later
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-28 11:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-28  7:17 [PATCH] ext4/048: Fix hangup due to no free inodes Ojaswin Mujoo
2025-10-28  7:57 ` Baokun Li
2025-10-28  9:39   ` Ojaswin Mujoo
2025-10-28 11:34     ` Baokun Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox