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>