mbox series

[0/3] btrfs: fixes for incoming sector perfect compression support

Message ID cover.1725599171.git.wqu@suse.com (mailing list archive)
Headers show
Series btrfs: fixes for incoming sector perfect compression support | expand

Message

Qu Wenruo Sept. 6, 2024, 5:16 a.m. UTC
Currently if a btrfs is mount with sector size < page size (aka,
subpage), then compression is only limited to range that is fully page
aligned.

This is mostly caused by the asynchonously submission for compression.

With recent changes in the page writeback path, we're closer and closer
to the sector perfect compression support for subpage.

Locally I have already enabled such support to shake out the remaining
bugs.

So far 2 obvious bugs are exposed by my local fstests runs.
They all share the same cause, incorrect assumption that one page is one
sector, thus some pointer is always increased by PAGE_SIZE, which is not
correct.

Fix both of them with a single line fix, then add an ASSERT() to ensure
the total read-in bytes never exceed the input range.

There is a remaining hang reproduced by btrfs/062, which I'm still
debugging, but I think sector perfect compression support is not that far
away anymore.

Qu Wenruo (3):
  btrfs: zlib: make the compression path to handle sector size < page
    size
  btrfs: zstd: make the compression path to handle sector size < page
    size
  btrfs: compression: add an ASSERT() to ensure the read-in length is
    sane

 fs/btrfs/compression.c | 3 +++
 fs/btrfs/zlib.c        | 2 +-
 fs/btrfs/zstd.c        | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)