From: Matthew Wilcox <willy@infradead.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: fsverity@lists.linux.dev, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fsverity: don't use bio_first_page_all() in fsverity_verify_bio()
Date: Sun, 4 Jun 2023 04:27:51 +0100 [thread overview]
Message-ID: <ZHwEty6ubvBnxIM+@casper.infradead.org> (raw)
In-Reply-To: <20230604022101.48342-1-ebiggers@kernel.org>
On Sat, Jun 03, 2023 at 07:21:01PM -0700, Eric Biggers wrote:
> bio_first_page_all(bio)->mapping->host is not compatible with large
> folios, since the first page of the bio is not necessarily the head page
> of the folio, and therefore it might not have the mapping pointer set.
Yes, that's true. It is going to depend on the filesystem, since these
two bios are equivalent:
(folio->page[0], offset=0x4000, len=0x300)
(folio->page[4], offset=0, len=0x300)
and we don't yet have a rule that filesystems must construct one or the
other. We probably _should_, but that was pretty low down my list of
things to care about right now.
> Therefore, move the dereference of ->mapping->host into
> verify_data_blocks(), which works with a folio.
Seems reasonable.
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> @@ -320,7 +321,6 @@ EXPORT_SYMBOL_GPL(fsverity_verify_blocks);
> */
> void fsverity_verify_bio(struct bio *bio)
> {
> - struct inode *inode = bio_first_page_all(bio)->mapping->host;
An alternative fix could be
struct folio *first = page_folio(bio_first_page_all(bio));
struct inode *inode = first->mapping->host;
Or we could add a bio_first_folio_all() that wraps that for you.
prev parent reply other threads:[~2023-06-04 3:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-04 2:21 [PATCH] fsverity: don't use bio_first_page_all() in fsverity_verify_bio() Eric Biggers
2023-06-04 3:27 ` Matthew Wilcox [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=ZHwEty6ubvBnxIM+@casper.infradead.org \
--to=willy@infradead.org \
--cc=ebiggers@kernel.org \
--cc=fsverity@lists.linux.dev \
--cc=linux-fsdevel@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 read-only IMAP folder(s) and NNTP newsgroup(s).