generic: add test for fsync after cloning file range
authorFilipe Manana <fdmanana@suse.com>
Thu, 12 Jul 2018 00:38:11 +0000 (01:38 +0100)
committerEryu Guan <guaneryu@gmail.com>
Sat, 14 Jul 2018 12:00:13 +0000 (20:00 +0800)
commitfcc3f3b9c39205b724fec5a8100767b435682a9f
tree463fde192ea343939f9d7816ff4cec8ed6cb2ccb
parent76b5a9d535eb9a4de76d5bf352d70d451b76cb69
generic: add test for fsync after cloning file range

Test that if we do a buffered write to a file, fsync it, clone a
range from another file into our file that overlaps the previously
written range, fsync the file again and then power fail, after we
mount again the filesystem, no file data was lost or corrupted.

This test is motivated by a bug found in btrfs, which is fixed by a
patch for the linux kernel titled:

  "Btrfs: fix file data corruption after cloning a range and fsync"

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/501 [new file with mode: 0755]
tests/generic/501.out [new file with mode: 0644]
tests/generic/group