From: sashiko-bot@kernel.org
To: "Andrey Albershteyn" <aalbersh@kernel.org>,
"Eric Biggers" <ebiggers@kernel.org>,
"Christoph Hellwig" <hch@lst.de>,
"Carlos Maiolino" <cem@kernel.org>,
fsverity <fsverity@lists.linux.dev>
Cc: david@fromorbit.com
Subject: Re: [PATCH v19 05/15] xfs: handle fsverity I/O in write/read path
Date: Fri, 20 Nov 2026 16:27:02 +0000 [thread overview]
Message-ID: <sashiko-outbox-225565@kernel.org> (raw)
In-Reply-To: <20261120155752.192025-6-aalbersh@kernel.org>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] xfs: undeclared fsverity_is_building() breaks build in
xfs_iomap.c
- [High] xfs: post-EOF fsverity folios skipped in writeback due to
missing flag
--
commit bdb3069c02095cd61adc7db45f468d33efe53e6b
Author: Andrey Albershteyn <aalbersh@kernel.org>
xfs: handle fsverity I/O in write/read path
This commit adds xfs_fsverity_metadata_offset() and passes the I/O offset
to xfs_bmbt_to_iomap() so IOMAP_F_FSVERITY is set on mappings covering
fs-verity metadata past EOF.
> diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
> index 1db6f3640c53b..b9728997f944a 100644
> --- a/fs/xfs/xfs_aops.c
> +++ b/fs/xfs/xfs_aops.c
> @@ -23,6 +23,7 @@
> #include "xfs_ioend.h"
> #include "xfs_zone_alloc.h"
> #include "xfs_rtgroup.h"
> +#include "xfs_verity.h"
>
> struct xfs_writepage_ctx {
> struct iomap_writepage_ctx ctx;
> @@ -265,7 +266,8 @@ xfs_map_blocks(
> isnullstartblock(imap.br_startblock))
> goto allocate_blocks;
>
> - xfs_bmbt_to_iomap(ip, &wpc->iomap, &imap, 0, 0, XFS_WPC(wpc)->data_seq);
> + xfs_bmbt_to_iomap(ip, &wpc->iomap, &imap, offset, 0, 0,
> + XFS_WPC(wpc)->data_seq);
> trace_xfs_map_blocks_found(ip, offset, count, whichfork, &imap);
> return 0;
> allocate_blocks:
> @@ -441,7 +443,7 @@ xfs_zoned_map_blocks(
> imap.br_startblock = HOLESTARTBLOCK;
> imap.br_state = XFS_EXT_NORM;
> xfs_iunlock(ip, XFS_ILOCK_EXCL);
> - xfs_bmbt_to_iomap(ip, &wpc->iomap, &imap, 0, 0, 0);
> + xfs_bmbt_to_iomap(ip, &wpc->iomap, &imap, offset, 0, 0, 0);
> return 0;
> }
> end_fsb = min(end_fsb, imap.br_startoff + imap.br_blockcount);
[Severity: High]
Will iomap_writeback_folio() skip dirty fs-verity metadata folios before
xfs_map_blocks() can set IOMAP_F_FSVERITY?
xfs_vm_writepages() zero-initializes wpc.ctx.iomap.flags (and
xc.ctx.iomap.flags on zoned filesystems), and iomap_writeback_folio()
calls iomap_writeback_handle_eof() before ->writeback_range() invokes
xfs_map_blocks(). When a dirty fs-verity folio past i_size is reached,
wpc->iomap.flags still lacks IOMAP_F_FSVERITY, so
iomap_writeback_handle_eof() returns false and the folio is skipped with
its dirty bit cleared and its delalloc extent unconverted.
Also, in xfs_zoned_map_blocks(), the non-hole path calls
xfs_iomap_set_anon_write(), which overwrites wpc->iomap.flags with
IOMAP_F_ANON_WRITE | IOMAP_F_DIRTY and drops IOMAP_F_FSVERITY.
> diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
> index 50eae7ff61453..5117704530f69 100644
> --- a/fs/xfs/xfs_iomap.c
> +++ b/fs/xfs/xfs_iomap.c
> @@ -32,6 +32,8 @@
> #include "xfs_rtbitmap.h"
> #include "xfs_icache.h"
> #include "xfs_zone_alloc.h"
> +#include "xfs_verity.h"
> +#include <linux/fsverity.h>
>
> #define XFS_ALLOC_ALIGN(mp, off) \
> (((off) >> mp->m_allocsize_log) << mp->m_allocsize_log)
> @@ -54,6 +56,15 @@ xfs_alert_fsblock_zero(
> return -EFSCORRUPTED;
> }
>
> +static bool
> +xfs_iomap_is_fsverity_metadata(
> + struct xfs_inode *ip,
> + loff_t offset)
> +{
> + return offset >= xfs_fsverity_metadata_offset(ip) &&
> + (fsverity_is_building(VFS_I(ip)) || fsverity_active(VFS_I(ip)));
> +}
[Severity: High]
Does calling fsverity_is_building() here break the build? Neither
linux/fsverity.h nor xfs_verity.h declares or defines
fsverity_is_building(), so compiling fs/xfs/xfs_iomap.c fails with an
implicit function declaration error.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120155752.192025-1-aalbersh@kernel.org?part=5
next prev parent reply other threads:[~2026-11-20 16:27 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 15:57 [PATCH v19 00/15] fs-verity support for XFS with post EOF merkle tree Andrey Albershteyn
2026-11-20 15:57 ` [PATCH v19 01/15] xfs: introduce fsverity on-disk changes Andrey Albershteyn
2026-11-20 16:26 ` sashiko-bot
2026-11-20 15:57 ` [PATCH v19 02/15] xfs: don't allow to enable DAX on fs-verity sealed inode Andrey Albershteyn
2026-11-20 15:57 ` [PATCH v19 03/15] xfs: disable direct read path for fs-verity files Andrey Albershteyn
2026-11-20 15:57 ` [PATCH v19 04/15] xfs: don't report dio_mem_align and dio_offset_align for fsverity files Andrey Albershteyn
2026-11-20 15:57 ` [PATCH v19 05/15] xfs: handle fsverity I/O in write/read path Andrey Albershteyn
2026-11-20 16:27 ` sashiko-bot [this message]
2026-11-20 15:57 ` [PATCH v19 06/15] xfs: use read ioend for fsverity data verification Andrey Albershteyn
2026-11-20 15:57 ` [PATCH v19 07/15] xfs: add XFS_BMAPI_UNWRITTEN to unmap unwritten extents in __xfs_bunmapi() Andrey Albershteyn
2026-11-20 15:57 ` [PATCH v19 08/15] xfs: don't remove written extents past EOF on fsverity inodes Andrey Albershteyn
2026-11-20 16:21 ` sashiko-bot
2026-11-20 15:57 ` [PATCH v19 09/15] xfs: add fs-verity support Andrey Albershteyn
2026-11-20 16:51 ` sashiko-bot
2026-11-20 15:57 ` [PATCH v19 10/15] xfs: initialize fs-verity on file open Andrey Albershteyn
2026-11-20 15:57 ` [PATCH v19 11/15] xfs: add fs-verity ioctls Andrey Albershteyn
2026-11-20 16:19 ` sashiko-bot
2026-11-20 15:57 ` [PATCH v19 12/15] xfs: advertise fs-verity being available on filesystem Andrey Albershteyn
2026-11-20 15:57 ` [PATCH v19 13/15] xfs: check and repair the verity inode flag state Andrey Albershteyn
2026-11-20 16:28 ` sashiko-bot
2026-11-20 15:57 ` [PATCH v19 14/15] xfs: introduce health state for corrupted fsverity metadata Andrey Albershteyn
2026-11-20 16:36 ` sashiko-bot
2026-11-20 15:57 ` [PATCH v19 15/15] xfs: enable ro-compat fs-verity flag Andrey Albershteyn
2026-11-20 16:38 ` sashiko-bot
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=sashiko-outbox-225565@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=aalbersh@kernel.org \
--cc=cem@kernel.org \
--cc=david@fromorbit.com \
--cc=ebiggers@kernel.org \
--cc=fsverity@lists.linux.dev \
--cc=hch@lst.de \
--cc=sashiko-reviews@lists.linux.dev \
/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.