btrfs: test direct IO write on NOCOW file when low on unallocated space
authorFilipe Manana <fdmanana@suse.com>
Thu, 28 Oct 2021 15:04:33 +0000 (16:04 +0100)
committerEryu Guan <guaneryu@gmail.com>
Sun, 31 Oct 2021 14:32:52 +0000 (22:32 +0800)
commit61cad300bd493cd35ef96bd89137993317cdc9bd
treea7a3954519cd2795eaaabd463192fb089235cf2b
parent45d3cae176a592717de3de6d13ab3cc29e730722
btrfs: test direct IO write on NOCOW file when low on unallocated space

Test that if we write to a range of a NOCOW file that has allocated
extents and there is not enough available free space for allocating new
data extents, the write succeeds. Test for direct IO and buffered IO
writes.

This currently fails on btrfs for the direct IO write scenario, only, but
while at it also test a buffered IO write, to help prevent regressions in
the future.

The patch that fixes the direct IO case has the following subject:

 "btrfs: fix ENOSPC failure when attempting direct IO write into NOCOW range"

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