linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/3] btrfs: fixes for incoming sector perfect compression support
Date: Fri,  6 Sep 2024 14:46:19 +0930	[thread overview]
Message-ID: <cover.1725599171.git.wqu@suse.com> (raw)

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(-)

-- 
2.46.0


             reply	other threads:[~2024-09-06  5:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-06  5:16 Qu Wenruo [this message]
2024-09-06  5:16 ` [PATCH 1/3] btrfs: zlib: make the compression path to handle sector size < page size Qu Wenruo
2024-09-06  5:16 ` [PATCH 2/3] btrfs: zstd: " Qu Wenruo
2024-09-06  5:16 ` [PATCH 3/3] btrfs: compression: add an ASSERT() to ensure the read-in length is sane Qu Wenruo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1725599171.git.wqu@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).