btrfs: test direct IO write against compressed extent
authorFilipe Manana <fdmanana@suse.com>
Mon, 21 Dec 2015 06:03:17 +0000 (17:03 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 21 Dec 2015 06:03:17 +0000 (17:03 +1100)
commite8341568c1b40df9235378d05682fac826d3cb02
treeea15b5186a12355f6706bfc18f63366ffc9d59c6
parente597459397acad3fcb19fa00e8a4abb8a59f8af2
btrfs: test direct IO write against compressed extent

Test that doing a direct IO write against a file range that contains one
prealloc extent and one compressed extent works correctly.

From the linux kernel 4.0 onwards, this either triggered an assertion
failure (leading to a BUG_ON) when CONFIG_BTRFS_ASSERT=y or resulted
in an arithmetic underflow of an inode's space reservation for write
operations.

That issue is fixed by the following linux kernel patch:

  "Btrfs: fix extent accounting for partial direct IO writes"

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
tests/btrfs/026 [new file with mode: 0644]
tests/btrfs/026.out [new file with mode: 0644]
tests/btrfs/group