From: sashiko-bot@kernel.org
To: "Andrey Albershteyn via Linux-f2fs-devel"
<linux-f2fs-devel@lists.sourceforge.net>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu, dsterba@suse.cz
Subject: Re: [f2fs-dev] [PATCH v17 19/21] xfs: check and repair the verity inode flag state
Date: Sat, 03 Oct 2026 01:34:23 +0000 [thread overview]
Message-ID: <20261003013424.08BC41F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261002223705.2175542-20-aalbersh@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] xfs: scrub aborts on fsverity validation errors -EINVAL and -EFBIG
--
commit 856d4488769e21ab11188de2cd348b2c2b9cb631
Author: Darrick J. Wong <djwong@kernel.org>
xfs: check and repair the verity inode flag state
If an inode has the incore verity iflag set, make sure that we can
actually activate fsverity on that inode. If activation fails due to
a fsverity metadata validation error, clear the flag.
> diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
> index e5233e31abb75..ebbef3afb7d6e 100644
> --- a/fs/xfs/scrub/common.c
> +++ b/fs/xfs/scrub/common.c
[ ... ]
> @@ -1754,3 +1756,54 @@ xchk_inode_count_blocks(
> return xfs_bmap_count_blocks(sc->tp, sc->ip, whichfork, nextents,
> count);
> }
> +
> +/*
> + * If this inode has S_VERITY set on it, read the verity info. If the reading
> + * fails with anything other than ENOMEM, the file is corrupt, which we can
> + * detect later with fsverity_active.
> + *
> + * Callers must hold the IOLOCK and must not hold the ILOCK of sc->ip because
> + * activation reads inode data.
> + */
> +int
> +xchk_inode_setup_verity(
> + struct xfs_scrub *sc)
> +{
> + int error;
> +
> + if (!fsverity_active(VFS_I(sc->ip)))
> + return 0;
> +
> + error = fsverity_ensure_verity_info(VFS_I(sc->ip));
> + switch (error) {
> + case 0:
> + /* fsverity is active */
> + break;
> + case -ENODATA:
> + case -EMSGSIZE:
> + case -EFSCORRUPTED:
> + case -ERANGE:
> + case -EBADMSG:
> + /*
> + * The nonzero errno codes above are the error codes that can
> + * be returned from fsverity on metadata validation errors.
> + */
> + return 0;
> + default:
> + /* runtime errors */
> + return error;
> + }
[Severity: Medium]
Should -EINVAL and -EFBIG be included in the allowed validation error codes?
A corrupted fsverity descriptor on disk can trigger
validate_fsverity_descriptor() to return -EINVAL or
fsverity_init_merkle_tree_params() to return -EFBIG.
Because they are omitted from this switch statement, they fall through to the
default case and return the error, aborting the scrub setup instead of
gracefully marking the inode as broken and continuing the repair pipeline.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261002223705.2175542-1-aalbersh@kernel.org?part=19
next prev parent reply other threads:[~2026-10-03 1:34 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 22:36 [PATCH v17 00/21] fs-verity support for XFS with post EOF merkle tree Andrey Albershteyn
2026-10-02 22:36 ` [PATCH v17 01/21] fsverity: report validation errors through fserror to fsnotify Andrey Albershteyn
2026-10-03 1:34 ` [f2fs-dev] " sashiko-bot
2026-10-02 22:36 ` [PATCH v17 02/21] fsverity: expose ensure_fsverity_info() Andrey Albershteyn
2026-10-03 1:34 ` [f2fs-dev] " sashiko-bot
2026-10-02 22:36 ` [PATCH v17 03/21] fsverity: pass digest size and hash of the all-zeroes block to ->write Andrey Albershteyn
2026-10-03 1:34 ` [f2fs-dev] " sashiko-bot
2026-10-02 22:36 ` [PATCH v17 04/21] fsverity: hoist pagecache_read from f2fs/ext4 to fsverity Andrey Albershteyn
2026-10-03 1:34 ` [f2fs-dev] " sashiko-bot
2026-10-02 22:36 ` [PATCH v17 05/21] fsverity: don't allow setting DAX file attribute on fsverity files Andrey Albershteyn
2026-10-03 1:34 ` sashiko-bot
2026-10-02 22:36 ` [PATCH v17 06/21] fsverity: hoist statx reporting of fs-verity flag Andrey Albershteyn
2026-10-03 1:34 ` sashiko-bot
2026-10-02 22:36 ` [PATCH v17 07/21] xfs: introduce fsverity on-disk changes Andrey Albershteyn
2026-10-03 1:34 ` sashiko-bot
2026-10-02 22:36 ` [PATCH v17 08/21] xfs: don't allow to enable DAX on fs-verity sealed inode Andrey Albershteyn
2026-10-03 1:34 ` sashiko-bot
2026-10-02 22:36 ` [PATCH v17 09/21] xfs: disable direct read path for fs-verity files Andrey Albershteyn
2026-10-03 1:34 ` [f2fs-dev] " sashiko-bot
2026-10-02 22:36 ` [PATCH v17 10/21] xfs: don't report dio_mem_align and dio_offset_align for fsverity files Andrey Albershteyn
2026-10-03 1:34 ` [f2fs-dev] " sashiko-bot
2026-10-02 22:36 ` [PATCH v17 11/21] xfs: handle fsverity I/O in write/read path Andrey Albershteyn
2026-10-03 1:34 ` [f2fs-dev] " sashiko-bot
2026-10-02 22:36 ` [PATCH v17 12/21] xfs: use read ioend for fsverity data verification Andrey Albershteyn
2026-10-03 1:34 ` [f2fs-dev] " sashiko-bot
2026-10-02 22:36 ` [PATCH v17 13/21] xfs: add XFS_BMAPI_UNWRITTEN to unmap unwritten extents in __xfs_bunmapi() Andrey Albershteyn
2026-10-03 1:34 ` [f2fs-dev] " sashiko-bot
2026-10-02 22:36 ` [PATCH v17 14/21] xfs: don't remove written extents past EOF on fsverity inodes Andrey Albershteyn
2026-10-03 1:34 ` [f2fs-dev] " sashiko-bot
2026-10-02 22:36 ` [PATCH v17 15/21] xfs: add fs-verity support Andrey Albershteyn
2026-10-03 1:34 ` [f2fs-dev] " sashiko-bot
2026-10-05 17:18 ` Andrey Albershteyn
2026-10-05 21:12 ` Darrick J. Wong
2026-10-06 9:03 ` Andrey Albershteyn
2026-10-02 22:36 ` [PATCH v17 16/21] xfs: initialize fs-verity on file open Andrey Albershteyn
2026-10-03 1:34 ` [f2fs-dev] " sashiko-bot
2026-10-02 22:36 ` [PATCH v17 17/21] xfs: add fs-verity ioctls Andrey Albershteyn
2026-10-03 1:34 ` [f2fs-dev] " sashiko-bot
2026-10-02 22:36 ` [PATCH v17 18/21] xfs: advertise fs-verity being available on filesystem Andrey Albershteyn
2026-10-03 1:34 ` [f2fs-dev] " sashiko-bot
2026-10-02 22:37 ` [PATCH v17 19/21] xfs: check and repair the verity inode flag state Andrey Albershteyn
2026-10-03 1:34 ` sashiko-bot [this message]
2026-10-02 22:37 ` [PATCH v17 20/21] xfs: introduce health state for corrupted fsverity metadata Andrey Albershteyn
2026-10-03 1:34 ` [f2fs-dev] " sashiko-bot
2026-10-02 22:37 ` [PATCH v17 21/21] xfs: enable ro-compat fs-verity flag Andrey Albershteyn
2026-10-03 1:34 ` [f2fs-dev] " sashiko-bot
2026-10-02 23:25 ` [PATCH v17 00/21] fs-verity support for XFS with post EOF merkle tree Eric Biggers
2026-10-03 12:07 ` Carlos Maiolino
2026-10-05 11:26 ` Andrey Albershteyn
2026-10-05 13:30 ` Eric Biggers
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=20261003013424.08BC41F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dsterba@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tytso@mit.edu \
/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