generic: test for non-zero used blocks while writing into a file
authorFilipe Manana <fdmanana@suse.com>
Mon, 9 Nov 2020 12:01:06 +0000 (12:01 +0000)
committerEryu Guan <guaneryu@gmail.com>
Sun, 15 Nov 2020 06:55:40 +0000 (14:55 +0800)
commit7a327ad2f4daab3f6aa253fc1c07ffcbecec637b
tree6d3fba6600260ebd422d070d98b3d9fd1c3b2bf6
parent609bb3562241f9fc877aff7309d62af6cb10795d
generic: test for non-zero used blocks while writing into a file

Test that if we keep overwriting an entire file, either with buffered
writes or direct IO writes, the number of used blocks reported by stat(2)
is never zero while the writes and writeback are in progress.

This is motivated by a bug in btrfs and currently fails on btrfs only. It
is fixed a patchset for btrfs that has the following patches:

  btrfs: fix missing delalloc new bit for new delalloc ranges
  btrfs: refactor btrfs_drop_extents() to make it easier to extend
  btrfs: fix race when defragging that leads to unnecessary IO
  btrfs: update the number of bytes used by an inode atomically

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