Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2218285/?format=api
{ "id": 2218285, "url": "http://patchwork.ozlabs.org/api/patches/2218285/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260331212827.2631020-8-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-8-aalbersh@kernel.org>", "list_archive_url": null, "date": "2026-03-31T21:28:08", "name": "[v6,07/22] iomap: teach iomap to read files with fsverity", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "09e7cf91ea2f6e70067fda13ce4183c3d4535326", "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-8-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/2218285/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2218285/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <SRS0=KhG8=B7=vger.kernel.org=linux-ext4+bounces-15554-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=Qnrp2Xao;\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=khg8=b7=vger.kernel.org=linux-ext4+bounces-15554-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)", "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=172.232.135.74 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=Qnrp2Xao;\n\tdkim-atps=neutral", "gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.232.135.74; helo=sto.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15554-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=\"Qnrp2Xao\"", "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 4flh9r5zLqz1yFv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 08:30:40 +1100 (AEDT)", "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4flh9r5Nb7z4wGT\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 08:30:40 +1100 (AEDT)", "by gandalf.ozlabs.org (Postfix)\n\tid 4flh9r56Zfz4wDJ; Wed, 01 Apr 2026 08:30:40 +1100 (AEDT)", "from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])\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 4flh9n0gBYz4wGT\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 01 Apr 2026 08:30:37 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id A12D3303AB10\n\tfor <patchwork-incoming@ozlabs.org>; Tue, 31 Mar 2026 21:29:42 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 01974466B66;\n\tTue, 31 Mar 2026 21:28:57 +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 B4BB0451051;\n\tTue, 31 Mar 2026 21:28:56 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id E83DDC2BCB3;\n\tTue, 31 Mar 2026 21:28:53 +0000 (UTC)" ], "ARC-Seal": [ "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1774992640; cv=pass;\n\tb=AM4mMNh8SI+H2QVuz3ZVvNPo1aft7wzSB8SiaHFaNup0XvGBpdnFYVysLGzb3Fn2UsWv2EhD5FtzSTvQU46jcEpQPJt3u3TUsJUf9tI7t6HF0UUROI5C8PyI6HVVmsdfxS8S2iQpxBRmVu7a0HwfG7T8UqkjwSwzkb0VXGzWIinIzOfELgiHyUTjjwEpFIXZ6gygUapKD3S/p3IEnbdLarCe8yW2Z5ieBOGnQMrY6fab7kw7kAEAn/Gj/jVeZEUvGKF8Rt2DLRAlk33dLWC29e691pH9HbefGDyn/q4+4srRDfhNN4yp+GHJG/+eB3CuwvjRYgBPhCawVF/sEsY5KQ==", "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774992536; cv=none;\n b=C7YBirW/QOlk50X18CM+iISFwVXBl+EsSSguBk95NeAsXzs7Cbg+5OCepkPLttn4p5h+j5Y4zUgjQ19DKecrkl1DsSXyzOkTnmkVLJk/squDAe0SfuJbA+Q6hrFqcANst1q5V9VmE7q817Zgf/9aQ+c9GbcMdwnpmbODGqnLDew=" ], "ARC-Message-Signature": [ "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1774992640; c=relaxed/relaxed;\n\tbh=6F6une6zWAfEWi/ze/kFwDAHzAC/ODMfB59U4CUZrRc=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=hWMv5Z2Umj8Qh/rTU+GRXS453GJFUOoDGDIhKu9Cde7Q7EUGLUFPVc0HrgufZbP7th8HmNCXcNFjDW1dtm3vdJtHx7LC+fLz1KMlrw/So2WxuWdtgvXYFfa9irxueBAag5DPQtqExwyHwYpyZYj0BFicfBCJ1q59qonUzjcjN/IcT64SJE2S777zMq4ORJPd4LSbiQYf/nTGn8OcGeLr5Z7uhZPR8Ebi2ZtCCFeS9Eyh2RnqV45mbF/j1Z2IP5H13eYjUIdBRSQnekS8Zx79WzuXfq/r7TD660kaBJ5oF+4oXBuFSs9Dy3KMWSsSb4ydh65cPWYFF+EVNkhR6wRbXQ==", "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774992536; c=relaxed/simple;\n\tbh=XCWROGtCYyLbcx0iLpbHbbLPDdXxb3iXCJlB6EEsxJM=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=scebC/OJQiHA/7WKq2vOqJiuz2UzeRfmHp58GHEf9lqNGSMSf1PF8hUqQh0BnxzD1hStNaCi9edsCqq6Ve+Bur2H3Ff4SyOSxDeCJs15cspfzsMcScRrCORdvv2caHSQ5TP+IcVRj6KuNycnvLuJBVzIH/CuG7kxj6wUTqLduFg=" ], "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=Qnrp2Xao; dkim-atps=neutral;\n spf=pass (client-ip=172.232.135.74; helo=sto.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15554-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=Qnrp2Xao; 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=1774992536;\n\tbh=XCWROGtCYyLbcx0iLpbHbbLPDdXxb3iXCJlB6EEsxJM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Qnrp2Xao1ZGTYLDBYd3QtWDUzg8l2O6AcmIgUXPTK36QIv0v7YnSKxvMiFrwHIwIN\n\t H8tnQdbMLkvT+/gg0K8HX+90IOjbM3r6nZTnpN6XsjfuTzbZD1uG3TDf75a782NdaA\n\t Bh787e2q1zdioQ2pthx4nqrMn/F3By4KQhJ1sMELC7CtMmg2ZcvqR2f1lCAx7QSn5Y\n\t HL+TzXyD0wmUNNIX2ZKdUTBLn4R/3Gy8+D/VDddItsK6xlMRmnRqaS+57w6/L0CUhC\n\t EKMfPCAOgf9v0NSTiuktmdCyZMMQPyYjPuTEuW7SjWyanpF156495C17N1ZMAB1a9f\n\t aRBqHYGyL/iWw==", "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 07/22] iomap: teach iomap to read files with fsverity", "Date": "Tue, 31 Mar 2026 23:28:08 +0200", "Message-ID": "<20260331212827.2631020-8-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": "Obtain fsverity info for folios with file data and fsverity metadata.\nFilesystem can pass vi down to ioend and then to fsverity for\nverification. This is different from other filesystems ext4, f2fs, btrfs\nsupporting fsverity, these filesystems don't need fsverity_info for\nreading fsverity metadata. While reading merkle tree iomap requires\nfsverity info to synthesize hashes for zeroed data block.\n\nfsverity metadata has two kinds of holes - ones in merkle tree and one\nafter fsverity descriptor.\n\nMerkle tree holes are blocks full of hashes of zeroed data blocks. These\nare not stored on the disk but synthesized on the fly. This saves a bit\nof space for sparse files. Due to this iomap also need to lookup\nfsverity_info for folios with fsverity metadata. ->vi has a hash of the\nzeroed data block which will be used to fill the merkle tree block.\n\nThe hole past descriptor is interpreted as end of metadata region. As we\ndon't have EOF here we use this hole as an indication that rest of the\nfolio is empty. This patch marks rest of the folio beyond fsverity\ndescriptor as uptodate.\n\nFor file data, fsverity needs to verify consistency of the whole file\nagainst the root hash, hashes of holes are included in the merkle tree.\nVerify them too.\n\nIssue reading of fsverity merkle tree on the fsverity inodes. This way\nmetadata will be available at I/O completion time.\n\nSigned-off-by: Andrey Albershteyn <aalbersh@kernel.org>\n---\n fs/iomap/buffered-io.c | 41 +++++++++++++++++++++++++++++++++++++++--\n include/linux/iomap.h | 2 ++\n 2 files changed, 41 insertions(+), 2 deletions(-)", "diff": "diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c\nindex a80fcb598cc8..7ac319618f8e 100644\n--- a/fs/iomap/buffered-io.c\n+++ b/fs/iomap/buffered-io.c\n@@ -9,6 +9,7 @@\n #include <linux/swap.h>\n #include <linux/migrate.h>\n #include <linux/fserror.h>\n+#include <linux/fsverity.h>\n #include \"internal.h\"\n #include \"trace.h\"\n \n@@ -561,9 +562,27 @@ static int iomap_read_folio_iter(struct iomap_iter *iter,\n \t\tif (plen == 0)\n \t\t\treturn 0;\n \n-\t\t/* zero post-eof blocks as the page may be mapped */\n-\t\tif (iomap_block_needs_zeroing(iter, pos)) {\n+\t\t/*\n+\t\t * Handling of fsverity \"holes\". We hit this for two case:\n+\t\t * 1. No need to go further, the hole after fsverity\n+\t\t *\tdescriptor is the end of the fsverity metadata.\n+\t\t *\n+\t\t * 2. This folio contains merkle tree blocks which need to be\n+\t\t *\tsynthesized. If we already have fsverity info (ctx->vi)\n+\t\t *\tsynthesize these blocks.\n+\t\t */\n+\t\tif ((iomap->flags & IOMAP_F_FSVERITY) &&\n+\t\t iomap->type == IOMAP_HOLE) {\n+\t\t\tif (ctx->vi)\n+\t\t\t\tfsverity_fill_zerohash(folio, poff, plen,\n+\t\t\t\t\t\t ctx->vi);\n+\t\t\tiomap_set_range_uptodate(folio, poff, plen);\n+\t\t} else if (iomap_block_needs_zeroing(iter, pos)) {\n+\t\t\t/* zero post-eof blocks as the page may be mapped */\n \t\t\tfolio_zero_range(folio, poff, plen);\n+\t\t\tif (ctx->vi &&\n+\t\t\t !fsverity_verify_blocks(ctx->vi, folio, plen, poff))\n+\t\t\t\treturn -EIO;\n \t\t\tiomap_set_range_uptodate(folio, poff, plen);\n \t\t} else {\n \t\t\tif (!*bytes_submitted)\n@@ -614,6 +633,15 @@ void iomap_read_folio(const struct iomap_ops *ops,\n \n \ttrace_iomap_readpage(iter.inode, 1);\n \n+\t/*\n+\t * Fetch fsverity_info for both data and fsverity metadata, as iomap\n+\t * needs zeroed hash for merkle tree block synthesis\n+\t */\n+\tctx->vi = fsverity_get_info(iter.inode);\n+\tif (ctx->vi && iter.pos < i_size_read(iter.inode))\n+\t\tfsverity_readahead(ctx->vi, folio->index,\n+\t\t\t\t folio_nr_pages(folio));\n+\n \twhile ((ret = iomap_iter(&iter, ops)) > 0)\n \t\titer.status = iomap_read_folio_iter(&iter, ctx,\n \t\t\t\t&bytes_submitted);\n@@ -681,6 +709,15 @@ void iomap_readahead(const struct iomap_ops *ops,\n \n \ttrace_iomap_readahead(rac->mapping->host, readahead_count(rac));\n \n+\t/*\n+\t * Fetch fsverity_info for both data and fsverity metadata, as iomap\n+\t * needs zeroed hash for merkle tree block synthesis\n+\t */\n+\tctx->vi = fsverity_get_info(iter.inode);\n+\tif (ctx->vi && iter.pos < i_size_read(iter.inode))\n+\t\tfsverity_readahead(ctx->vi, readahead_index(rac),\n+\t\t\t\treadahead_count(rac));\n+\n \twhile (iomap_iter(&iter, ops) > 0)\n \t\titer.status = iomap_readahead_iter(&iter, ctx,\n \t\t\t\t\t&cur_bytes_submitted);\ndiff --git a/include/linux/iomap.h b/include/linux/iomap.h\nindex 4506a99d5285..4d9202cae29f 100644\n--- a/include/linux/iomap.h\n+++ b/include/linux/iomap.h\n@@ -435,6 +435,7 @@ struct iomap_ioend {\n \tloff_t\t\t\tio_offset;\t/* offset in the file */\n \tsector_t\t\tio_sector;\t/* start sector of ioend */\n \tvoid\t\t\t*io_private;\t/* file system private data */\n+\tstruct fsverity_info\t*io_vi;\t\t/* fsverity info */\n \tstruct bio\t\tio_bio;\t\t/* MUST BE LAST! */\n };\n \n@@ -509,6 +510,7 @@ struct iomap_read_folio_ctx {\n \tstruct readahead_control *rac;\n \tvoid\t\t\t*read_ctx;\n \tloff_t\t\t\tread_ctx_file_offset;\n+\tstruct fsverity_info\t*vi;\n };\n \n struct iomap_read_ops {\n", "prefixes": [ "v6", "07/22" ] }