From: Qu Wenruo <wqu@suse.com>
To: Boris Burkov <boris@bur.io>,
linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 0/2] fixes for btrfs_read_folio races
Date: Sat, 14 Dec 2024 09:47:43 +1030 [thread overview]
Message-ID: <032a4fcd-e24a-43b2-8ddd-da43558e23da@suse.com> (raw)
In-Reply-To: <cover.1734131353.git.boris@bur.io>
在 2024/12/14 09:43, Boris Burkov 写道:
> We have a common pattern of getting a folio (locked) checking if it is
> uptodate, then reading it with btrfs_read_folio if it is not.
>
> btrfs_read_folio returns the folio unlocked, so we immediately lock it
> again with folio_lock. However, in the time that it is unlocked, a
> different thread can modify folio->mapping (like set it NULL with
> an invalidate) so we must also check that folio->mapping is still what
> we expect after folio_lock. Most users of btrfs_read_folio do it
> correctly (retry on mismatched folio->mapping), and this series tidies
> up a couple that were doing it wrong.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Thanks,
Qu
>
> Boris Burkov (2):
> btrfs: fix btrfs_read_folio race in relocation
> btrfs: fix btrfs_read_folio race in send
>
> fs/btrfs/relocation.c | 6 ++++++
> fs/btrfs/send.c | 6 ++++++
> 2 files changed, 12 insertions(+)
>
prev parent reply other threads:[~2024-12-13 23:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-13 23:13 [PATCH 0/2] fixes for btrfs_read_folio races Boris Burkov
2024-12-13 23:13 ` [PATCH 1/2] btrfs: fix btrfs_read_folio race in relocation Boris Burkov
2024-12-13 23:13 ` [PATCH 2/2] btrfs: fix btrfs_read_folio race in send Boris Burkov
2024-12-13 23:17 ` Qu Wenruo [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=032a4fcd-e24a-43b2-8ddd-da43558e23da@suse.com \
--to=wqu@suse.com \
--cc=boris@bur.io \
--cc=kernel-team@fb.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