From: Christoph Hellwig <hch@lst.de>
To: Andrey Albershteyn <aalbersh@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>,
Andrey Albershteyn <aalbersh@kernel.org>,
linux-xfs@vger.kernel.org, fsverity@lists.linux.dev,
linux-fsdevel@vger.kernel.org, ebiggers@kernel.org,
djwong@kernel.org
Subject: Re: [PATCH v3 11/35] iomap: allow filesystem to read fsverity metadata beyound EOF
Date: Fri, 20 Feb 2026 16:31:13 +0100 [thread overview]
Message-ID: <20260220153113.GA14359@lst.de> (raw)
In-Reply-To: <bltgc6uliclhzkuqd4la2tzp6x7vsww73nvjedxh7s624tby3k@jw4ij5irh6ni>
On Thu, Feb 19, 2026 at 03:23:11PM +0100, Andrey Albershteyn wrote:
> On 2026-02-19 14:38:29, Christoph Hellwig wrote:
> > On Thu, Feb 19, 2026 at 12:11:18PM +0100, Andrey Albershteyn wrote:
> > > > > fsverity descriptor. This is basically the case as for EOF folio.
> > > > > Descriptor is the end of the fsverity metadata region. If we have 1k
> > > > > fs blocks (= merkle blocks) we can have [descriptor | hole ] folio.
> > > > > As we are not limited by i_size here, iomap_block_needs_zeroing()
> > > > > won't fire to zero this hole. So, this case is to mark this tail as
> > > > > uptodate.
> > > >
> > > > How do we end up in that without ctx->vi set?
> > >
> > > We're reading it
> >
> > Did a part of that sentence get lost?
>
> I mean that to have ctx->vi we need to read fsverity descriptor
> first. When iomap is reading fsverity descriptor inode won't have
> any fsverity_info yet.
So for ext4/f2fs the pattern is that it is set by:
if (folio->index < DIV_ROUND_UP(inode->i_size, PAGE_SIZE))
vi = fsverity_get_info(inode);
i.e., only for reading the data. OTOH, for iomap we do:
if (fsverity_active(iter.inode)) {
ctx->vi = fsverity_get_info(iter.inode);
which means it now is set for all I/O on fsverity files, which
is subtly different.
(You don't actually need the fsverity_active chck, fsverity_get_info
already does that, btw).
I'm still not sure what "When iomap is reading fsverity descriptor
inode" means.
> > Another overly long line here. Also we should avoid the
> > fsverity_active check here, as it causes a rhashtable lookup. F2fs
> > and ext4 just check ctx->vi, but based on the checks above, we seem
> > to set this also for (some) reads of the fsverity metadata. But as
> > we exclude IOMAP_F_FSVERITY above, we might actually be fine with a
> > ctx->vi anyway.
>
> Don't you confused this with fsverity_get_info()? I don't see how it
> could cause lookup.
Yeah. Still, having ctx->vi implies fsverity_active, and follows
what we're doing elsewhere.
>
> >
> > Please document the rules for ctx->vi while were it.
> >
>
> Hmm, the vi is set in iomap_read_folio() [1] and then used down
> through I/O up to ioend completion. What info you would like to see
> there?
See above, unlike ext4/f2fs we set it for all I/O on fsverity inodes.
And afaik we don't actually need it, the only use in the fsverity
metadata path is the fill zeroes hash values check (which I'm still
totally confused about).
next prev parent reply other threads:[~2026-02-20 15:31 UTC|newest]
Thread overview: 94+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-17 23:19 [PATCH v3 00/35] fs-verity support for XFS with post EOF merkle tree Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 01/35] fsverity: report validation errors back to the filesystem Andrey Albershteyn
2026-02-18 21:40 ` Darrick J. Wong
2026-02-17 23:19 ` [PATCH v3 02/35] fsverity: expose ensure_fsverity_info() Andrey Albershteyn
2026-02-18 21:41 ` Darrick J. Wong
2026-02-17 23:19 ` [PATCH v3 03/35] fsverity: add consolidated pagecache offset for metadata Andrey Albershteyn
2026-02-18 6:17 ` Christoph Hellwig
2026-02-18 21:57 ` Darrick J. Wong
2026-02-19 13:09 ` Andrey Albershteyn
2026-02-19 17:16 ` Darrick J. Wong
2026-02-17 23:19 ` [PATCH v3 04/35] fsverity: generate and store zero-block hash Andrey Albershteyn
2026-02-18 22:04 ` Darrick J. Wong
2026-02-19 13:00 ` Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 05/35] fsverity: introduce fsverity_folio_zero_hash() Andrey Albershteyn
2026-02-18 22:53 ` Darrick J. Wong
2026-02-19 12:45 ` Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 06/35] fsverity: pass digest size and hash of the empty block to ->write Andrey Albershteyn
2026-02-18 6:18 ` Christoph Hellwig
2026-02-18 12:17 ` Andrey Albershteyn
2026-02-19 5:58 ` Christoph Hellwig
2026-02-19 6:30 ` Eric Biggers
2026-02-23 13:23 ` Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 07/35] iomap: introduce IOMAP_F_FSVERITY Andrey Albershteyn
2026-02-18 23:03 ` Darrick J. Wong
2026-02-19 6:00 ` Christoph Hellwig
2026-02-19 6:04 ` Darrick J. Wong
2026-02-17 23:19 ` [PATCH v3 08/35] iomap: don't limit fsverity metadata by EOF in writeback Andrey Albershteyn
2026-02-18 23:05 ` Darrick J. Wong
2026-02-19 12:27 ` Andrey Albershteyn
2026-02-20 16:42 ` Matthew Wilcox
2026-02-20 16:44 ` Christoph Hellwig
2026-02-17 23:19 ` [PATCH v3 09/35] iomap: obtain fsverity info for read path Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 10/35] iomap: issue readahead for fsverity merkle tree Andrey Albershteyn
2026-02-18 23:06 ` Darrick J. Wong
2026-02-17 23:19 ` [PATCH v3 11/35] iomap: allow filesystem to read fsverity metadata beyound EOF Andrey Albershteyn
2026-02-18 6:36 ` Christoph Hellwig
2026-02-18 9:41 ` Andrey Albershteyn
2026-02-19 6:04 ` Christoph Hellwig
2026-02-19 11:11 ` Andrey Albershteyn
2026-02-19 13:38 ` Christoph Hellwig
2026-02-19 14:23 ` Andrey Albershteyn
2026-02-20 15:31 ` Christoph Hellwig [this message]
2026-02-23 15:10 ` Andrey Albershteyn
2026-02-24 14:42 ` Christoph Hellwig
2026-02-17 23:19 ` [PATCH v3 12/35] iomap: let fsverity verify holes Andrey Albershteyn
2026-02-18 23:09 ` Darrick J. Wong
2026-02-17 23:19 ` [PATCH v3 13/35] xfs: use folio host instead of file struct Andrey Albershteyn
2026-02-18 6:32 ` Christoph Hellwig
2026-02-18 9:42 ` Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 14/35] xfs: add fs-verity ro-compat flag Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 15/35] xfs: add inode on-disk VERITY flag Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 16/35] xfs: initialize fs-verity on file open Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 17/35] xfs: don't allow to enable DAX on fs-verity sealed inode Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 18/35] xfs: disable direct read path for fs-verity files Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 19/35] xfs: introduce XFS_FSVERITY_CONSTRUCTION inode flag Andrey Albershteyn
2026-02-18 23:10 ` Darrick J. Wong
2026-02-17 23:19 ` [PATCH v3 20/35] xfs: introduce XFS_FSVERITY_REGION_START constant Andrey Albershteyn
2026-02-18 6:33 ` Christoph Hellwig
2026-02-18 23:11 ` Darrick J. Wong
2026-02-17 23:19 ` [PATCH v3 21/35] xfs: disable preallocations for fsverity Merkle tree writes Andrey Albershteyn
2026-02-18 23:12 ` Darrick J. Wong
2026-02-17 23:19 ` [PATCH v3 22/35] xfs: add iomap write/writeback and reading of Merkle tree pages Andrey Albershteyn
2026-02-18 6:35 ` Christoph Hellwig
2026-02-18 10:18 ` Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 23/35] xfs: add helper to check that inode data need fsverity verification Andrey Albershteyn
2026-02-18 6:38 ` Christoph Hellwig
2026-02-18 9:46 ` Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 24/35] xfs: use read ioend for fsverity data verification Andrey Albershteyn
2026-02-18 6:39 ` Christoph Hellwig
2026-02-17 23:19 ` [PATCH v3 25/35] xfs: add helpers to convert between pagecache and on-disk offset Andrey Albershteyn
2026-02-18 23:20 ` Darrick J. Wong
2026-02-17 23:19 ` [PATCH v3 26/35] xfs: add a helper to decide if bmbt record needs offset conversion Andrey Albershteyn
2026-02-19 17:41 ` Darrick J. Wong
2026-02-17 23:19 ` [PATCH v3 27/35] xfs: use different on-disk and pagecache offset for fsverity Andrey Albershteyn
2026-02-19 19:30 ` Darrick J. Wong
2026-02-17 23:19 ` [PATCH v3 28/35] xfs: add fs-verity support Andrey Albershteyn
2026-02-18 6:44 ` Christoph Hellwig
2026-02-18 9:57 ` Andrey Albershteyn
2026-02-19 6:11 ` Christoph Hellwig
2026-02-19 9:51 ` Andrey Albershteyn
2026-02-19 13:41 ` Christoph Hellwig
2026-02-19 14:38 ` Andrey Albershteyn
2026-02-19 17:29 ` Darrick J. Wong
2026-02-17 23:19 ` [PATCH v3 29/35] xfs: add fs-verity ioctls Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 30/35] xfs: advertise fs-verity being available on filesystem Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 31/35] xfs: check and repair the verity inode flag state Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 32/35] xfs: report verity failures through the health system Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 33/35] xfs: introduce health state for corrupted fsverity metadata Andrey Albershteyn
2026-02-19 17:34 ` Darrick J. Wong
2026-02-23 18:19 ` Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 34/35] xfs: add fsverity traces Andrey Albershteyn
2026-02-19 17:36 ` Darrick J. Wong
2026-02-23 18:12 ` Andrey Albershteyn
2026-02-17 23:19 ` [PATCH v3 35/35] xfs: enable ro-compat fs-verity flag Andrey Albershteyn
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=20260220153113.GA14359@lst.de \
--to=hch@lst.de \
--cc=aalbersh@kernel.org \
--cc=aalbersh@redhat.com \
--cc=djwong@kernel.org \
--cc=ebiggers@kernel.org \
--cc=fsverity@lists.linux.dev \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@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