btrfs: test writing into unwritten extent right before snapshotting
authorFilipe Manana <fdmanana@suse.com>
Mon, 6 Aug 2018 08:08:39 +0000 (09:08 +0100)
committerEryu Guan <guaneryu@gmail.com>
Sun, 12 Aug 2018 11:42:40 +0000 (19:42 +0800)
commit7931e0696c8e77b3172b5fb0b2ffa9a16597462d
treea0435914ade14b81a0c4412a62f6555f915d4050
parent3a64a884c4405e4494be44c8f52e0ba3f17d5b84
btrfs: test writing into unwritten extent right before snapshotting

Test that if we write into an unwritten extent of a file when there
is no more space left to allocate in the filesystem and then
snapshot the file's subvolume, after a clean shutdown the data was
not lost.

This test is motivated by a bug found by Robbie Ko for which there
is a fix whose patch title is:

  "Btrfs: fix unexpected failure of nocow buffered writes after
   snapshotting when low on space"

Reported-by: Robbie Ko <robbieko@synology.com>
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/170 [new file with mode: 0755]
tests/btrfs/170.out [new file with mode: 0644]
tests/btrfs/group