btrfs: clone a hole post eof when using NO_HOLES feature
authorFilipe Manana <fdmanana@suse.com>
Tue, 16 Feb 2021 11:10:15 +0000 (11:10 +0000)
committerEryu Guan <guaneryu@gmail.com>
Sun, 7 Mar 2021 14:40:31 +0000 (22:40 +0800)
commitbdad282d47daddc0f2f7f18f30bd25a636535de4
tree90d983b59a2ef620b06a4e639eac1abf767f5998
parent656e1b10820d9f05cfecf90f79d91c78cb77b0ae
btrfs: clone a hole post eof when using NO_HOLES feature

Test that when using the NO_HOLES feature, if we truncate down a
file, clone a file range covering only a hole into an offset beyond
the current file size, and then fsync the file, after a power
failure we get the expected file content and we do not get stale
data corresponding to file extents that existed before truncating
the file.

This currently fails on btrfs and is fixed by commit 3660d0bcdb82
("btrfs: fix stale data exposure after cloning a hole with NO_HOLES
enabled")

[Eryu: add the commit id of the patch fixing the bug]

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