From: Greg KH <greg@kroah.com>
To: Qu Wenruo <wqu@suse.com>
Cc: stable@vger.kernel.org, linux-btrfs@vger.kernel.org,
Matt Corallo <blnxfsl@bluematt.me>,
Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>
Subject: Re: [PATCH stable-5.15.y] btrfs: force v2 space cache usage for subpage mount
Date: Mon, 9 May 2022 16:32:35 +0200 [thread overview]
Message-ID: <YnkmA3hE5LnVz3KQ@kroah.com> (raw)
In-Reply-To: <edc6262ba229edce38a63b70960ffc170287ee11.1652088466.git.wqu@suse.com>
On Mon, May 09, 2022 at 05:28:56PM +0800, Qu Wenruo wrote:
> commit 9f73f1aef98b2fa7252c0a89be64840271ce8ea0 upstream.
>
> [BUG]
> For a 4K sector sized btrfs with v1 cache enabled and only mounted on
> systems with 4K page size, if it's mounted on subpage (64K page size)
> systems, it can cause the following warning on v1 space cache:
>
> BTRFS error (device dm-1): csum mismatch on free space cache
> BTRFS warning (device dm-1): failed to load free space cache for block group 84082688, rebuilding it now
>
> Although not a big deal, as kernel can rebuild it without problem, such
> warning will bother end users, especially if they want to switch the
> same btrfs seamlessly between different page sized systems.
>
> [CAUSE]
> V1 free space cache is still using fixed PAGE_SIZE for various bitmap,
> like BITS_PER_BITMAP.
>
> Such hard-coded PAGE_SIZE usage will cause various mismatch, from v1
> cache size to checksum.
>
> Thus kernel will always reject v1 cache with a different PAGE_SIZE with
> csum mismatch.
>
> [FIX]
> Although we should fix v1 cache, it's already going to be marked
> deprecated soon.
>
> And we have v2 cache based on metadata (which is already fully subpage
> compatible), and it has almost everything superior than v1 cache.
>
> So just force subpage mount to use v2 cache on mount.
>
> Reported-by: Matt Corallo <blnxfsl@bluematt.me>
> CC: stable@vger.kernel.org # 5.15+
> Link: https://lore.kernel.org/linux-btrfs/61aa27d1-30fc-c1a9-f0f4-9df544395ec3@bluematt.me/
> Reviewed-by: Josef Bacik <josef@toxicpanda.com>
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
> fs/btrfs/disk-io.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
Now queued up, thanks.
greg k-h
prev parent reply other threads:[~2022-05-09 14:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-09 9:28 [PATCH stable-5.15.y] btrfs: force v2 space cache usage for subpage mount Qu Wenruo
2022-05-09 14:32 ` Greg KH [this message]
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=YnkmA3hE5LnVz3KQ@kroah.com \
--to=greg@kroah.com \
--cc=blnxfsl@bluematt.me \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=wqu@suse.com \
/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