generic: test attempt to dedup eof block into the middle of a file
Test that deduplication of an entire file that has a size that is not
aligned to the filesystem's block size into the middle of a different
file does not corrupt the destination's file data by reflinking the last
(eof) block.
This test 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")
dceeb47b0ed6 ("xfs: fix data corruption w/ unaligned dedupe ranges")
de02b9f6bb65 ("Btrfs: fix data corruption when deduplicating between different files")
Btrfs: fix infinite loop on inode eviction after deduplication of eof block
The VFS patch was added to kernel 4.20-rc1 and the XFS and first Btrfs
patches were added to kernel 4.19. The second patch for Btrfs 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>