btrfs: test fsync after increasing file size with truncate
authorFilipe Manana <fdmanana@suse.com>
Tue, 6 Jul 2021 14:42:17 +0000 (15:42 +0100)
committerEryu Guan <guaneryu@gmail.com>
Sun, 18 Jul 2021 06:43:02 +0000 (14:43 +0800)
commit8ae8a045b54d31e4d3b9f6e003edfe4f045ed692
treea158d613f12c77a7af372a026aa962101ed9631e
parent2226eece67ba241302f025a1b166cc9df3853076
btrfs: test fsync after increasing file size with truncate

Test that if we explicitly fsync a file that was previously renamed and
its size was increased through a truncate operation, after a power failure
the file has the size set by the truncate operation. Also, in between the
truncation and the fsync, there was a rename of another file in the same
directory and that file was also fsynced before we fsynced the file that
was truncated.

This currently fails on a 5.13 kernel and on Linus' master branch. It is
fixed by a patch with the following subject:

  "btrfs: fix unpersisted i_size on fsync after expanding truncate"

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