]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
ext4/307: Calculate donor size to avoid failures for 64k bs
authorOjaswin Mujoo <ojaswin@linux.ibm.com>
Wed, 1 Apr 2026 10:09:41 +0000 (15:39 +0530)
committerZorro Lang <zlang@kernel.org>
Tue, 12 May 2026 17:13:30 +0000 (01:13 +0800)
commit0d6ed520323d82dbb0f9ad77a7a63e48d01a3c4e
treef70165a230fb7e777b6fc15b4c9843ffa8751bda
parent3aca6733f6cd93cbf000b7dbfc8af128796e2425
ext4/307: Calculate donor size to avoid failures for 64k bs

Calculating size of donor file based on du output causes the following
issue:

e4compact.c:68: do_defrag_range: Assertion `donor->length >= len' failed.
./common/rc: line 4616: 1583182 Aborted                 (core dumped)

The issue is that e4compat asserts that the stat.st_size of all files
combined shouldn't be more than that of the donor file. In case of 64k
blocksize, fsstress often creates sparse files which have >3G size even
though their disk utilization is <100M. Since donor file is not big
enough, this trips e4compat causing the failure.

Fix this by using stat.st_size rather than du value to get the size.
Also, make some changes to avoid future ENOSPC like reducing the -n
passed to fsstress to keep the size around 2G and making sure we use the
whole SCRATCH disk instead of 500M.

While we are at it, add some new lines to make the code bit more
readable.

Reported-by: Disha Goel <disgoel@linux.ibm.com>
Tested-by: Disha Goel <disgoel@linux.ibm.com>
Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/ext4/307