]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
generic: test attempt to reflink eof block into the middle of a file
authorFilipe Manana <fdmanana@suse.com>
Mon, 5 Nov 2018 11:15:01 +0000 (11:15 +0000)
committerEryu Guan <guaneryu@gmail.com>
Sun, 11 Nov 2018 14:00:31 +0000 (22:00 +0800)
commitb5d3e961fe0a674dff7d773ce6e8dd546fe153c3
tree80c0a639998a85dad3fb6b0a5f018a300f2d7119
parent91540ef980110f78161893f98d946e2afa0c1f4a
generic: test attempt to reflink eof block into the middle of a file

Test that we can not clone a range from a file A into the middle of a file B
when the range includes the last block of file A and file A's size is not
aligned with the filesystem's block size. Allowing such case would lead to
data corruption since the data between EOF and the end of its block is
undefined.

This is motivated by a bug recently found that affects both Btrfs and XFS
and is fixed by the following commits/patches for the linux kernel:

 07d19dc9fbe9 ("vfs: avoid problematic remapping requests into partial EOF block")
 b39989009bdb ("xfs: fix data corruption w/ unaligned reflink ranges")
 Btrfs: fix data corruption due to cloning of eof block

The VFS patch landed in kernel 4.20-rc1 and the XFS patch landed in 4.19.
The Btrfs fix is very recent and it is not yet in Linus' tree.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/518 [new file with mode: 0755]
tests/generic/518.out [new file with mode: 0644]
tests/generic/group