get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2218291/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2218291,
    "url": "http://patchwork.ozlabs.org/api/patches/2218291/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260331212827.2631020-14-aalbersh@kernel.org/",
    "project": {
        "id": 8,
        "url": "http://patchwork.ozlabs.org/api/projects/8/?format=api",
        "name": "Linux ext4 filesystem development",
        "link_name": "linux-ext4",
        "list_id": "linux-ext4.vger.kernel.org",
        "list_email": "linux-ext4@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260331212827.2631020-14-aalbersh@kernel.org>",
    "list_archive_url": null,
    "date": "2026-03-31T21:28:14",
    "name": "[v6,13/22] xfs: handle fsverity I/O in write/read path",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "13dabc0c6e38e3f8af05af83c4885d8099d4966b",
    "submitter": {
        "id": 92821,
        "url": "http://patchwork.ozlabs.org/api/people/92821/?format=api",
        "name": "Andrey Albershteyn",
        "email": "aalbersh@kernel.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260331212827.2631020-14-aalbersh@kernel.org/mbox/",
    "series": [
        {
            "id": 498255,
            "url": "http://patchwork.ozlabs.org/api/series/498255/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/list/?series=498255",
            "date": "2026-03-31T21:28:01",
            "name": "fs-verity support for XFS with post EOF merkle tree",
            "version": 6,
            "mbox": "http://patchwork.ozlabs.org/series/498255/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2218291/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2218291/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <SRS0=DGA9=B7=vger.kernel.org=linux-ext4+bounces-15560-patchwork-incoming=ozlabs.org@ozlabs.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-ext4@vger.kernel.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "patchwork-incoming@ozlabs.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=faIIK2it;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=2404:9400:2221:ea00::3; helo=mail.ozlabs.org;\n envelope-from=srs0=dga9=b7=vger.kernel.org=linux-ext4+bounces-15560-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)",
            "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=172.105.105.114 arc.chain=subspace.kernel.org",
            "gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org",
            "gandalf.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=faIIK2it;\n\tdkim-atps=neutral",
            "gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.105.105.114; helo=tor.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15560-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"faIIK2it\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"
        ],
        "Received": [
            "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4flhLb3Qqhz1yGH\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 08:38:15 +1100 (AEDT)",
            "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4flhLb2qVYz4wGx\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 08:38:15 +1100 (AEDT)",
            "by gandalf.ozlabs.org (Postfix)\n\tid 4flhLb2kL7z58df; Wed, 01 Apr 2026 08:38:15 +1100 (AEDT)",
            "from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4flhLW5NK5z4wGx\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 01 Apr 2026 08:38:11 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id BF1EC3176049\n\tfor <patchwork-incoming@ozlabs.org>; Tue, 31 Mar 2026 21:30:35 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id D6EB4472760;\n\tTue, 31 Mar 2026 21:29:14 +0000 (UTC)",
            "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 91AA34657C6;\n\tTue, 31 Mar 2026 21:29:14 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id AF300C19423;\n\tTue, 31 Mar 2026 21:29:11 +0000 (UTC)"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1774993095; cv=pass;\n\tb=tebwRKA+c4/gNGYsbNym5fLr8b4dT6vibL7umBIUapdeAkofsZEu39i2oVDc4A8XwaycLbtHI4MxTBUTPumGYurUiA+gGTLWxfKUvNvKN3lb8gVLSiF0tWDnVB+fg603WkZkhy2Ovkew6ZrobqIzgjPOax0LdvSsO/eTQw+PUaajfvkwi5kIC4dGRw0bpB92uaNjcMwfIIat8vNNvcp6CoEPOYms+6UOKnT+DN7hUBKFEE/JaSQBuO8gr3QarCqJlmqM9CxtHpvhyz3RXVyhCLHDUx+Hf2fT/lpEaT+lBJZZCabr0sIVJZ/m9LOsn5pZ0D7thj6iBV7keli/MnirnQ==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774992554; cv=none;\n b=nAQ+spIOTMRh++sEj2xxtDdlgMQkiPq7UEm3c3d+8LHmcrCURjdIZomeWQym3oKfhfcPuI310GPLY8VejVbNO7ftCG7lfKusYGTytt4O42yGilt6UZuSpxLYapJDQoCf6HjF9/b5QQi2I31xFOoh+BaTietSQBxNmoMKek8Y/K4="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1774993095; c=relaxed/relaxed;\n\tbh=JQMn7/pHftSJixQzu0kgU4cfVdz9isvZpD5i4+flGHs=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=rDhSVZTD/FrX7UcJ/tsjk8Q8/YzRr33+0jTFrZE/BMnAgMWYFd/7NOqiqcH3tXkvTNV97bBRffurTlT6Pm6p4RbM+k2HUcOvyzGJ8tmtvvxkTUYyNNRQlj02491xzjlsWbIpxpEp7sYt4iPN7DUvO7Rbr637G6EuVFNRxgstIPga7b4ZH8hZO2sVYOpBs4RNbghnfBbMa/Pe1oLbqG7duFUK8RiubjYHKk0AlHnpRRFoHu79i2vAlUBTL1ZpQ6fj2bCC+xNNNsttO/w+9Wn9J3rcuSJi7NYWuPckXEmmxYbV/TGW//4E21+pkgCwrfPJoEi0GbyPYerGpL5Esd5slw==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774992554; c=relaxed/simple;\n\tbh=wPwMqkZVCP+6/reA6SK7YxDZjcmllpxADXdpUpSnyII=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=gYCCOanjhkgPp0fgo0OjRnkTScqjKgSTPFbThdU0E2ydTukGkkrF0NVcFFyZBrIO3p4x8LGlwJDiMxSmtEBxUmYUehl8hc9TRSluTbWqiNnVWPimXM0CzrEha0XQOGxIjZkTDomc+6mapvrWCV7KGlpsHJYbL8T4oLJo+33C8W8="
        ],
        "ARC-Authentication-Results": [
            "i=2; gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org;\n dkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=faIIK2it; dkim-atps=neutral;\n spf=pass (client-ip=172.105.105.114; helo=tor.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15560-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org",
            "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=faIIK2it; arc=none smtp.client-ip=10.30.226.201"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1774992554;\n\tbh=wPwMqkZVCP+6/reA6SK7YxDZjcmllpxADXdpUpSnyII=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=faIIK2ituZxtvRx7Xr2EaimR3moKZfyPp9ez5gPmq5KL5xcRPrmOf0fm0SnTzIW5U\n\t LNAqn34DNROVTOCDvgWAP2O/3z/GUDSXWn5DCJg64PXpYf6v08TnzDeyF9npKzLmal\n\t osVo3rVED2Ff+OGmYXHfPJqOFwYa3ZIz2OfvMbP5ctjq5CDS2+jNsKFoetgubU0b7R\n\t qZjl49Jr4sgLHlSfepuy7nXCkNwd5GH5ZI688Co3fDUFmwboOQTnP6+NCv91RLn6La\n\t IEdWQYNmOnALvH1mScSvgpevsaobSmBJlq4+RrsRqNQozhgKlEX2LQCkIhZd/YI6RE\n\t hG85OlLv4JgfA==",
        "From": "Andrey Albershteyn <aalbersh@kernel.org>",
        "To": "linux-xfs@vger.kernel.org,\n\tfsverity@lists.linux.dev,\n\tlinux-fsdevel@vger.kernel.org,\n\tebiggers@kernel.org",
        "Cc": "Andrey Albershteyn <aalbersh@kernel.org>,\n\thch@lst.de,\n\tlinux-ext4@vger.kernel.org,\n\tlinux-f2fs-devel@lists.sourceforge.net,\n\tlinux-btrfs@vger.kernel.org,\n\tdjwong@kernel.org",
        "Subject": "[PATCH v6 13/22] xfs: handle fsverity I/O in write/read path",
        "Date": "Tue, 31 Mar 2026 23:28:14 +0200",
        "Message-ID": "<20260331212827.2631020-14-aalbersh@kernel.org>",
        "X-Mailer": "git-send-email 2.51.2",
        "In-Reply-To": "<20260331212827.2631020-1-aalbersh@kernel.org>",
        "References": "<20260331212827.2631020-1-aalbersh@kernel.org>",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-ext4@vger.kernel.org",
        "List-Id": "<linux-ext4.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-ext4+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-ext4+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Spam-Status": "No, score=-1.2 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,\n\tMAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=disabled\n\tversion=4.0.1",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"
    },
    "content": "For write/writeback set IOMAP_F_FSVERITY flag telling iomap to not\nupdate inode size and to not skip folios beyond EOF.\n\nInitiate fsverity writeback with IOMAP_F_FSVERITY set to tell iomap\nshould not skip folio that is dirty beyond EOF.\n\nIn read path let iomap know that we are reading fsverity metadata. So,\ntreat holes in the tree as request to synthesize tree blocks and hole\nafter descriptor as end of the fsverity region.\n\nIntroduce a new inode flag meaning that merkle tree is being build on\nthe inode.\n\nReviewed-by: Darrick J. Wong <djwong@kernel.org>\nReviewed-by: Christoph Hellwig <hch@lst.de>\nSigned-off-by: Andrey Albershteyn <aalbersh@kernel.org>\n---\n fs/xfs/Makefile          |  1 +\n fs/xfs/libxfs/xfs_bmap.c |  7 +++++++\n fs/xfs/xfs_aops.c        | 16 +++++++++++++++-\n fs/xfs/xfs_fsverity.c    | 21 +++++++++++++++++++++\n fs/xfs/xfs_fsverity.h    | 20 ++++++++++++++++++++\n fs/xfs/xfs_inode.h       |  6 ++++++\n fs/xfs/xfs_iomap.c       | 15 +++++++++++++--\n 7 files changed, 83 insertions(+), 3 deletions(-)\n create mode 100644 fs/xfs/xfs_fsverity.c\n create mode 100644 fs/xfs/xfs_fsverity.h",
    "diff": "diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile\nindex 9f7133e02576..38b7f51e5d84 100644\n--- a/fs/xfs/Makefile\n+++ b/fs/xfs/Makefile\n@@ -149,6 +149,7 @@ xfs-$(CONFIG_XFS_POSIX_ACL)\t+= xfs_acl.o\n xfs-$(CONFIG_SYSCTL)\t\t+= xfs_sysctl.o\n xfs-$(CONFIG_COMPAT)\t\t+= xfs_ioctl32.o\n xfs-$(CONFIG_EXPORTFS_BLOCK_OPS)\t+= xfs_pnfs.o\n+xfs-$(CONFIG_FS_VERITY)\t\t+= xfs_fsverity.o\n \n # notify failure\n ifeq ($(CONFIG_MEMORY_FAILURE),y)\ndiff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c\nindex 7a4c8f1aa76c..931d02678d19 100644\n--- a/fs/xfs/libxfs/xfs_bmap.c\n+++ b/fs/xfs/libxfs/xfs_bmap.c\n@@ -41,6 +41,8 @@\n #include \"xfs_inode_util.h\"\n #include \"xfs_rtgroup.h\"\n #include \"xfs_zone_alloc.h\"\n+#include \"xfs_fsverity.h\"\n+#include <linux/fsverity.h>\n \n struct kmem_cache\t\t*xfs_bmap_intent_cache;\n \n@@ -4451,6 +4453,11 @@ xfs_bmapi_convert_one_delalloc(\n \tXFS_STATS_ADD(mp, xs_xstrat_bytes, XFS_FSB_TO_B(mp, bma.length));\n \tXFS_STATS_INC(mp, xs_xstrat_quick);\n \n+\tif (xfs_iflags_test(ip, XFS_VERITY_CONSTRUCTION) &&\n+\t    XFS_FSB_TO_B(mp, bma.got.br_startoff) >=\n+\t\t    xfs_fsverity_metadata_offset(ip))\n+\t\tflags |= IOMAP_F_FSVERITY;\n+\n \tASSERT(!isnullstartblock(bma.got.br_startblock));\n \txfs_bmbt_to_iomap(ip, iomap, &bma.got, 0, flags,\n \t\t\t\txfs_iomap_inode_sequence(ip, flags));\ndiff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c\nindex f279055fcea0..9503252a0fa4 100644\n--- a/fs/xfs/xfs_aops.c\n+++ b/fs/xfs/xfs_aops.c\n@@ -22,6 +22,7 @@\n #include \"xfs_icache.h\"\n #include \"xfs_zone_alloc.h\"\n #include \"xfs_rtgroup.h\"\n+#include \"xfs_fsverity.h\"\n #include <linux/bio-integrity.h>\n \n struct xfs_writepage_ctx {\n@@ -339,12 +340,16 @@ xfs_map_blocks(\n \tint\t\t\tretries = 0;\n \tint\t\t\terror = 0;\n \tunsigned int\t\t*seq;\n+\tunsigned int\t\tiomap_flags = 0;\n \n \tif (xfs_is_shutdown(mp))\n \t\treturn -EIO;\n \n \tXFS_ERRORTAG_DELAY(mp, XFS_ERRTAG_WB_DELAY_MS);\n \n+\tif (xfs_iflags_test(ip, XFS_VERITY_CONSTRUCTION))\n+\t\tiomap_flags |= IOMAP_F_FSVERITY;\n+\n \t/*\n \t * COW fork blocks can overlap data fork blocks even if the blocks\n \t * aren't shared.  COW I/O always takes precedent, so we must always\n@@ -432,7 +437,8 @@ xfs_map_blocks(\n \t    isnullstartblock(imap.br_startblock))\n \t\tgoto allocate_blocks;\n \n-\txfs_bmbt_to_iomap(ip, &wpc->iomap, &imap, 0, 0, XFS_WPC(wpc)->data_seq);\n+\txfs_bmbt_to_iomap(ip, &wpc->iomap, &imap, 0, iomap_flags,\n+\t\t\t  XFS_WPC(wpc)->data_seq);\n \ttrace_xfs_map_blocks_found(ip, offset, count, whichfork, &imap);\n \treturn 0;\n allocate_blocks:\n@@ -705,6 +711,14 @@ xfs_vm_writepages(\n \t\t\t},\n \t\t};\n \n+\t\t/*\n+\t\t * Writeback does not work for folios past EOF, let it know that\n+\t\t * I/O happens for fsverity metadata and this restriction need\n+\t\t * to be skipped\n+\t\t */\n+\t\tif (xfs_iflags_test(ip, XFS_VERITY_CONSTRUCTION))\n+\t\t\twpc.ctx.iomap.flags |= IOMAP_F_FSVERITY;\n+\n \t\treturn iomap_writepages(&wpc.ctx);\n \t}\n }\ndiff --git a/fs/xfs/xfs_fsverity.c b/fs/xfs/xfs_fsverity.c\nnew file mode 100644\nindex 000000000000..6e6a8636a577\n--- /dev/null\n+++ b/fs/xfs/xfs_fsverity.c\n@@ -0,0 +1,21 @@\n+/* SPDX-License-Identifier: GPL-2.0 */\n+/*\n+ * Copyright (C) 2026 Red Hat, Inc.\n+ */\n+#include \"xfs_platform.h\"\n+#include \"xfs_format.h\"\n+#include \"xfs_inode.h\"\n+#include \"xfs_shared.h\"\n+#include \"xfs_trans_resv.h\"\n+#include \"xfs_mount.h\"\n+#include \"xfs_fsverity.h\"\n+#include \"xfs_fsverity.h\"\n+#include <linux/fsverity.h>\n+#include <linux/iomap.h>\n+\n+loff_t\n+xfs_fsverity_metadata_offset(\n+\tconst struct xfs_inode\t*ip)\n+{\n+\treturn round_up(i_size_read(VFS_IC(ip)), XFS_FSVERITY_START_ALIGN);\n+}\ndiff --git a/fs/xfs/xfs_fsverity.h b/fs/xfs/xfs_fsverity.h\nnew file mode 100644\nindex 000000000000..5771db2cd797\n--- /dev/null\n+++ b/fs/xfs/xfs_fsverity.h\n@@ -0,0 +1,20 @@\n+/* SPDX-License-Identifier: GPL-2.0 */\n+/*\n+ * Copyright (C) 2026 Red Hat, Inc.\n+ */\n+#ifndef __XFS_FSVERITY_H__\n+#define __XFS_FSVERITY_H__\n+\n+#include \"xfs_platform.h\"\n+\n+#ifdef CONFIG_FS_VERITY\n+loff_t xfs_fsverity_metadata_offset(const struct xfs_inode *ip);\n+#else\n+static inline loff_t xfs_fsverity_metadata_offset(const struct xfs_inode *ip)\n+{\n+\tWARN_ON_ONCE(1);\n+\treturn ULLONG_MAX;\n+}\n+#endif\t/* CONFIG_FS_VERITY */\n+\n+#endif\t/* __XFS_FSVERITY_H__ */\ndiff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h\nindex bd6d33557194..6df48d68a919 100644\n--- a/fs/xfs/xfs_inode.h\n+++ b/fs/xfs/xfs_inode.h\n@@ -415,6 +415,12 @@ static inline bool xfs_inode_can_sw_atomic_write(const struct xfs_inode *ip)\n  */\n #define XFS_IREMAPPING\t\t(1U << 15)\n \n+/*\n+ * fs-verity's Merkle tree is under construction. The file is read-only, the\n+ * only writes happening are for the fsverity metadata.\n+ */\n+#define XFS_VERITY_CONSTRUCTION\t(1U << 16)\n+\n /* All inode state flags related to inode reclaim. */\n #define XFS_ALL_IRECLAIM_FLAGS\t(XFS_IRECLAIMABLE | \\\n \t\t\t\t XFS_IRECLAIM | \\\ndiff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c\nindex 9c2f12d5fec9..71ccd4ff5f48 100644\n--- a/fs/xfs/xfs_iomap.c\n+++ b/fs/xfs/xfs_iomap.c\n@@ -32,6 +32,8 @@\n #include \"xfs_rtbitmap.h\"\n #include \"xfs_icache.h\"\n #include \"xfs_zone_alloc.h\"\n+#include \"xfs_fsverity.h\"\n+#include <linux/fsverity.h>\n \n #define XFS_ALLOC_ALIGN(mp, off) \\\n \t(((off) >> mp->m_allocsize_log) << mp->m_allocsize_log)\n@@ -1789,6 +1791,9 @@ xfs_buffered_write_iomap_begin(\n \t\treturn xfs_direct_write_iomap_begin(inode, offset, count,\n \t\t\t\tflags, iomap, srcmap);\n \n+\tif (xfs_iflags_test(ip, XFS_VERITY_CONSTRUCTION))\n+\t\tiomap_flags |= IOMAP_F_FSVERITY;\n+\n \terror = xfs_qm_dqattach(ip);\n \tif (error)\n \t\treturn error;\n@@ -2113,12 +2118,17 @@ xfs_read_iomap_begin(\n \tbool\t\t\tshared = false;\n \tunsigned int\t\tlockmode = XFS_ILOCK_SHARED;\n \tu64\t\t\tseq;\n+\tunsigned int\t\tiomap_flags = 0;\n \n \tASSERT(!(flags & (IOMAP_WRITE | IOMAP_ZERO)));\n \n \tif (xfs_is_shutdown(mp))\n \t\treturn -EIO;\n \n+\tif (fsverity_active(inode) &&\n+\t    (offset >= xfs_fsverity_metadata_offset(ip)))\n+\t\tiomap_flags |= IOMAP_F_FSVERITY;\n+\n \terror = xfs_ilock_for_iomap(ip, flags, &lockmode);\n \tif (error)\n \t\treturn error;\n@@ -2132,8 +2142,9 @@ xfs_read_iomap_begin(\n \tif (error)\n \t\treturn error;\n \ttrace_xfs_iomap_found(ip, offset, length, XFS_DATA_FORK, &imap);\n-\treturn xfs_bmbt_to_iomap(ip, iomap, &imap, flags,\n-\t\t\t\t shared ? IOMAP_F_SHARED : 0, seq);\n+\tiomap_flags |= shared ? IOMAP_F_SHARED : 0;\n+\n+\treturn xfs_bmbt_to_iomap(ip, iomap, &imap, flags, iomap_flags, seq);\n }\n \n const struct iomap_ops xfs_read_iomap_ops = {\n",
    "prefixes": [
        "v6",
        "13/22"
    ]
}