]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic/562: Make test compatible with block sizes till 64k
authorNirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
Mon, 13 Oct 2025 05:39:42 +0000 (05:39 +0000)
committerZorro Lang <zlang@kernel.org>
Fri, 17 Oct 2025 19:25:27 +0000 (03:25 +0800)
This test fails with 64k sector size in btrfs. The reason for
this is the need for additional space because of COW. When
the reflink/clone of file bar into file foo is done, there
is no additional space left for COW - the reason is that the
metadata space usage is much higher with 64k node size.
In order to verify this, I instrumented the test script and
disabled COW for file foo and bar and the test passes in 64k
(and runs faster too).

With 64k sector and node size (COW enabled)
After pwriting foo and bar and before filling up the fs
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop1      512M  324M  3.0M 100% /mnt1/scratch
After filling up the fs
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop1      512M  441M  3.0M 100% /mnt1/scratch

With 64k sector and node size (COW disabled)
After pwriting foo and bar and before filling up the fs
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop1      512M  224M  231M  50% /mnt1/scratch
After filling up the fs
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop1      512M  424M   31M  94% /mnt1/scratch

As we can see, with COW, the fs is completely full after
filling up the fs but with COW disabled, we have some
space left.

Fix this by increasing the fs size to 590M so that even with
64k node size and COW enabled, reflink has enough space to
continue.

Reported-by: Disha Goel <disgoel@linux.ibm.com>
Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/562

index 03a66ff2a436f5bc7f347c7c3fa70bf1084f5dc7..b9562730eac98eb772adbe4e1c0d1d7906ef09d3 100755 (executable)
@@ -22,7 +22,7 @@ _require_scratch_reflink
 _require_test_program "punch-alternating"
 _require_xfs_io_command "fpunch"
 
-_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1
+_scratch_mkfs_sized $((590 * 1024 * 1024)) >>$seqres.full 2>&1
 _scratch_mount
 
 file_size=$(( 200 * 1024 * 1024 )) # 200Mb