btrfs: allow compression even if the range is not page aligned
authorQu Wenruo <wqu@suse.com>
Fri, 6 Sep 2024 02:52:56 +0000 (12:22 +0930)
committerDavid Sterba <dsterba@suse.com>
Mon, 11 Nov 2024 13:34:13 +0000 (14:34 +0100)
commit1d2fbb7f1f9e33eb448c7d2e2ae883801c8c4a21
tree0b11075e42c585cb00747e691479ff2c13085b47
parentc96d0e3921419bd3e5d8a1f355970c8ae3047ef4
btrfs: allow compression even if the range is not page aligned

Previously for btrfs with sector size smaller than page size (subpage),
we only allow compression if the range is fully page aligned.

This is to work around the asynchronous submission of compressed range,
which delayed the page unlock and writeback into a workqueue,
furthermore asynchronous submission can lock multiple sector range
across page boundary.

Such asynchronous submission makes it very hard to co-operate with other
regular writes.

With the recent changes to the subpage folio unlock path, now
asynchronous submission of compressed pages can co-operate with regular
submission, so enable sector perfect compression if it's an experimental
build.

The ETA for moving this feature out of experimental is 6.15, and I hope
all remaining corner cases can be exposed before that.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c