btrfs/189: make the test work on systems with a page size greater than 4Kb

The test currently uses offsets and lengths which are multiples of
4K, but not multiples of 64K (or any other page size between 4Kb and
64Kb). This makes the reflink calls fail with -EINVAL because
reflink only operates on ranges that are aligned to the the
filesystem's block size.

Fix this by ensuring all ranges passed to the reflink calls are
aligned to 64K, so that the test works on any system regardless of
its page size.  The test still fails without the corresponding
kernel fix applied [1] as it is supposed to.

[1] 3c850b45110950 ("Btrfs: incremental send, fix emission of invalid clone operations")

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Filipe Manana
2019-07-05 12:26:21 +01:00
committed by Eryu Guan
parent 856f357c6a
commit 55cc523b0e
2 changed files with 8 additions and 6 deletions
+2 -2
View File
@@ -9,9 +9,9 @@ wrote 2097152/2097152 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/base'
At subvol SCRATCH_MNT/base
linked 102400/102400 bytes at offset 512000
linked 131072/131072 bytes at offset 655360
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
linked 102400/102400 bytes at offset 0
linked 131072/131072 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/incr'
At subvol SCRATCH_MNT/incr