btrfs: Check false ENOSPC bug caused by incorrect metadata reserve
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Thu, 10 Nov 2016 03:18:48 +0000 (11:18 +0800)
committerEryu Guan <eguan@redhat.com>
Sun, 13 Nov 2016 06:01:06 +0000 (14:01 +0800)
commit089ecbf486301c8a7d12919bf6daaa2cb44daf04
tree92248413840620bc98b41134b76655ae586f1518
parent08adb2554ea282b6c0daf11f7905e94ffe55c111
btrfs: Check false ENOSPC bug caused by incorrect metadata reserve

Due to the fact that btrfs uses different max extent size for
compressed and non-compressed write, it calculates metadata
reservation incorrectly.

This can leads to false ENOSPC alert for compressed write.

This test case will check it by using small fs and do parallel write
to trigger it.

It's highly recommened to use MOUNT_OPTIONS="-o compress" and
MKFS_OPTIONS="-n 64k" to trigger it. Without compression, it won't
be triggered.

The fix is not merged and may change in the future, but the function
is good enough:

btrfs: improve inode's outstanding_extents computation
btrfs: fix false enospc for compression

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/btrfs/132 [new file with mode: 0755]
tests/btrfs/132.out [new file with mode: 0644]
tests/btrfs/group