From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH v2 0/2] btrfs: two small and safe fixes for large folios
Date: Tue, 1 Apr 2025 18:20:27 +1030 [thread overview]
Message-ID: <cover.1743493507.git.wqu@suse.com> (raw)
[CHANGELOG]
v2:
- Fix a bug that page_pgoff() usage lacks left page shift
Two small and simple fixes.
The first one is that with large folios, we can have order 6 folios which
reached our current BITS_PER_LONG limit, triggering a previously
impossible ASSERT(), which is based on the fact that our largest page
size (64K) can not reach BITS_PER_LONG blocks per page.
An easily fix by extending the ASSERT() condition to cover
blocks_per_folio == BITS_PER_LONG cases.
The second one is a little more complex, that with large folios, if we
still go through the single page bio vec iteration, we can not call
page_offset(), as non-head pages of a large folio do not have their
page::index initialized properly.
Fix that by going a helper using page_pgoff() to calculate the file
offset, which handles both head and non-head pages of a large folio.
Qu Wenruo (2):
btrfs: fix the ASSERT() inside GET_SUBPAGE_BITMAP()
btrfs: fix the file offset calculation inside
btrfs_decompress_buf2page()
fs/btrfs/compression.c | 18 +++++++++++++++++-
fs/btrfs/subpage.c | 2 +-
2 files changed, 18 insertions(+), 2 deletions(-)
--
2.49.0
next reply other threads:[~2025-04-01 7:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-01 7:50 Qu Wenruo [this message]
2025-04-01 7:50 ` [PATCH v2 1/2] btrfs: fix the ASSERT() inside GET_SUBPAGE_BITMAP() Qu Wenruo
2025-04-01 15:44 ` Filipe Manana
2025-04-01 7:50 ` [PATCH v2 2/2] btrfs: fix the file offset calculation inside btrfs_decompress_buf2page() Qu Wenruo
2025-04-01 15:49 ` Filipe Manana
2025-04-01 16:20 ` [PATCH v2 0/2] btrfs: two small and safe fixes for large folios Boris Burkov
2025-04-01 18:29 ` Sweet Tea Dorminy
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.1743493507.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.