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>
_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