Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2221455/?format=api
{ "id": 2221455, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2221455/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260409131404.1545834-15-aalbersh@kernel.org/", "project": { "id": 8, "url": "http://patchwork.ozlabs.org/api/1.2/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": "<20260409131404.1545834-15-aalbersh@kernel.org>", "list_archive_url": null, "date": "2026-04-09T13:13:46", "name": "[v7,14/22] xfs: handle fsverity I/O in write/read path", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "13dabc0c6e38e3f8af05af83c4885d8099d4966b", "submitter": { "id": 92821, "url": "http://patchwork.ozlabs.org/api/1.2/people/92821/?format=api", "name": "Andrey Albershteyn", "email": "aalbersh@kernel.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260409131404.1545834-15-aalbersh@kernel.org/mbox/", "series": [ { "id": 499292, "url": "http://patchwork.ozlabs.org/api/1.2/series/499292/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/list/?series=499292", "date": "2026-04-09T13:13:34", "name": "fs-verity support for XFS with post EOF merkle tree", "version": 7, "mbox": "http://patchwork.ozlabs.org/series/499292/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2221455/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2221455/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <SRS0=JH9m=CI=vger.kernel.org=linux-ext4+bounces-15711-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=e1zQh4cV;\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=jh9m=ci=vger.kernel.org=linux-ext4+bounces-15711-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)", "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=\"2600:3c09:e001:a7::12fc:5321\"\n 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=e1zQh4cV;\n\tdkim-atps=neutral", "gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15711-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=\"e1zQh4cV\"", "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 4fs0sl3n8fz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 23:20:11 +1000 (AEST)", "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4fs0sl3JTVz4wLh\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 23:20:11 +1000 (AEST)", "by gandalf.ozlabs.org (Postfix)\n\tid 4fs0sl3DG7z4wLM; Thu, 09 Apr 2026 23:20:11 +1000 (AEST)", "from sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::12fc:5321])\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 4fs0sg5XKLz4wLh\n\tfor <patchwork-incoming@ozlabs.org>; Thu, 09 Apr 2026 23:20:07 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 3714C303E1F9\n\tfor <patchwork-incoming@ozlabs.org>; Thu, 9 Apr 2026 13:17:29 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 9E54B3B38B4;\n\tThu, 9 Apr 2026 13:14:53 +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 A7B443D34A4;\n\tThu, 9 Apr 2026 13:14:52 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id E526DC2BC87;\n\tThu, 9 Apr 2026 13:14:49 +0000 (UTC)" ], "ARC-Seal": [ "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1775740811; cv=pass;\n\tb=ACJHed7ztIf7FqxUA5HH8txS01jRpF1wa9fQh7AxB3s7qH1Nf4PQ7+p64//E3l3YzhoC9eKVArteqq9liROCwC3dYAWbvX1BL3OKUtBDdP0KoUsSxUy6xS1j5LL1IATeB8LyxDS1SQmvbW3GkrII7RdGpwL28EusvKR8VcDdzEFnxoxf+v6KRWPnLSB3DoFW55imOi7NkUqKFdfm2Thv2nnGrBqhWOncWloKhM2dY+3r+mhty91UsytT+XTKY6hwY2xHZ2vDWidZB3EFmqr48N1uxIgbwcn9bwKv7jTkHRCLf0QA4E7PB/13Hau62EjxAPcAarzfyi+m/P9C/11Yzg==", "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775740492; cv=none;\n b=fYlUqpyG06ANS+A+8RFNR99dNpNGuM7y2WAcuvz7n6tUrGFRzU4FFkNK/ZDgPqyfhziw0lL9/KGxGkGqeca0+Uk7ffItP2izJDld16IExWqhjTd/77opL0gjZ1TUGZ59oX9b928Ejty/2r5KwB2ZaXVFAlBVciDKJbSljR9JrFo=" ], "ARC-Message-Signature": [ "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1775740811; 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=CMGiRTvstg2AIlAmjToYpWi4T5AaZKar3hqFL8v5ufcPhdqXkM9ybAy77m+hIaydKVHLGxDALrpa/kLhwHbFidWNuIXK+GG1soAxFxVqERdg9LmOJyHlIKQGU1AjSypebAhhCkJ6TZOrRv+Kbt8WsH2hccHVhsnnPP1JkV7OdrKQBH0rt17RbxZasNj9dlKo4+Rf3kyrAIk5AkJE9ppQ6cVMu069wJ4fZ2s9iLge5tPQS4ok+Ug+ZAVb5dvWfs4gkKF9LJyJnSXkt0Ail5gvrGp+5+Z83OJDBFkDMw7bj+m4eb+bXEbHanGEZVLM5eaatc5ZG+KipNspJ83bC/PCgg==", "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775740492; 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=X5GTisT/VLOHpVuN55dPJpkAgW02JIMBHSTiBFbzo+nCYvbpXR99zxh72CmCeLB7hOgOTZ8Mfz6KllwF7IrV7D1TgaGE2fb3H/bXTSBgFa8fTUlrfR5oPhFg1LIIQ7mc79oonx++Inp+kq476uoQVZW8H49iSgg4atxMHxgvuNA=" ], "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=e1zQh4cV; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15711-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=e1zQh4cV; 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=1775740492;\n\tbh=wPwMqkZVCP+6/reA6SK7YxDZjcmllpxADXdpUpSnyII=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=e1zQh4cVDiUi9yepkbnfGw+vH5G4YRc2A3fqLAlGN4RbIdtMXwDMcC7oqJy7BnI3E\n\t /PRDdnWDY0Szm12repLMvb7Kv7V34wCeRtuJp08eIPvWkWdlbEva8DlaOd8oKLObjl\n\t pI+xle19e5sXIDOxMRhG0V68YI/jCYWfnho7rFBhuoFvBWGlIXIlytikrQsCooGiY5\n\t FOuy1SBeTS/70LvoSkpfV2nB67k86TpHASWLhhJBrNXGAkwuMMxSfKtcIOPXRu270w\n\t dUOsd1+pxVSo+luco/cBe5NpE0+kRZd4B7Xkcx6nBIKjPatZaf418qdnrIN/361DSA\n\t H4AqNC3XOkGrQ==", "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 v7 14/22] xfs: handle fsverity I/O in write/read path", "Date": "Thu, 9 Apr 2026 15:13:46 +0200", "Message-ID": "<20260409131404.1545834-15-aalbersh@kernel.org>", "X-Mailer": "git-send-email 2.51.2", "In-Reply-To": "<20260409131404.1545834-1-aalbersh@kernel.org>", "References": "<20260409131404.1545834-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": [ "v7", "14/22" ] }