From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH v2 0/4] btrfs: fix all bugs introduced in the compressed_folios[] removal
Date: Thu, 19 Feb 2026 18:51:10 +1030 [thread overview]
Message-ID: <cover.1771488629.git.wqu@suse.com> (raw)
[CHANGELOG]
v2:
- Fix an unaligned bio size on x86_64 triggering btrfs/333
We can still have an unaligned size for the encoded write, in that
case we still need to roundup the bio to fs block boundary.
I'm a total idiot, that my usual 64K page sized arm64 VM is configured
back to use 4K page size for bs > ps runs, but forgot to revert the
config back.
This makes all recent arm64 runs use 4K page size, making it almost
no different than x86_64 runs.
This means the recent compressed_folios[] cleanup is not really properly
tested for bs < ps cases at all.
Thus all the regressions are not properly detected during the
development.
In fact commit e1bc83f8b157 ("btrfs: get rid of compressed_folios[] usage
for encoded writes") introduced two bugs in just one go, one can even
lead to data corruption for bs < ps cases.
All bugs are caught by dded ASSERT()s, but some ASSERT()s are just
incorrect in the first place, like patch 2~4.
Meanwhile the first one can lead to data corruption if
CONFIG_BTRFS_ASSERT is not selected, thus it will need higher priority.
Again, very sorry for my super stupid arm64 kernel config error.
Will no longer run 4K page sized kernel on that VM any more, and deploy
a new VM for 4K page sized tests, with proper kernel string suffix to
indicate the page size in the future.
Qu Wenruo (4):
btrfs: fix a bug that makes encoded write bio larger than expected
btrfs: do not touch page cache for encoded writes
btrfs: fix an incorrect ASSERT() condition inside
zstd_decompress_bio()
btrfs: fix an incorrect ASSERT() condition inside lzo_decompress_bio()
fs/btrfs/compression.c | 11 ++++++++---
fs/btrfs/inode.c | 7 ++++---
fs/btrfs/lzo.c | 4 ++--
fs/btrfs/zstd.c | 2 +-
4 files changed, 15 insertions(+), 9 deletions(-)
--
2.52.0
next reply other threads:[~2026-02-19 8:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-19 8:21 Qu Wenruo [this message]
2026-02-19 8:21 ` [PATCH v2 1/4] btrfs: fix a bug that makes encoded write bio larger than expected Qu Wenruo
2026-02-19 15:06 ` Filipe Manana
2026-02-19 8:21 ` [PATCH v2 2/4] btrfs: do not touch page cache for encoded writes Qu Wenruo
2026-02-19 15:03 ` Filipe Manana
2026-02-19 8:21 ` [PATCH v2 3/4] btrfs: fix an incorrect ASSERT() condition inside zstd_decompress_bio() Qu Wenruo
2026-02-19 15:09 ` Filipe Manana
2026-02-19 8:21 ` [PATCH v2 4/4] btrfs: fix an incorrect ASSERT() condition inside lzo_decompress_bio() Qu Wenruo
2026-02-19 15:20 ` Filipe Manana
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.1771488629.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