Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2218284/?format=api
{ "id": 2218284, "url": "http://patchwork.ozlabs.org/api/patches/2218284/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260331212827.2631020-7-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-7-aalbersh@kernel.org>", "list_archive_url": null, "date": "2026-03-31T21:28:07", "name": "[v6,06/22] iomap: introduce IOMAP_F_FSVERITY and teach writeback to handle fsverity", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "f2bd40a002d8b7a5b1482a5ea46fa6dc5061c724", "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-7-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/2218284/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2218284/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <SRS0=ZjCR=B7=vger.kernel.org=linux-ext4+bounces-15553-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=XO+aKq7H;\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=zjcr=b7=vger.kernel.org=linux-ext4+bounces-15553-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=XO+aKq7H;\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-15553-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=\"XO+aKq7H\"", "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 4flh9V15ZNz1yFv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 08:30:22 +1100 (AEDT)", "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4flh9V0XLwz4wGT\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 08:30:22 +1100 (AEDT)", "by gandalf.ozlabs.org (Postfix)\n\tid 4flh9V0Nzpz4wDJ; Wed, 01 Apr 2026 08:30:22 +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 4flh9Q3pfNz58dq\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 01 Apr 2026 08:30:18 +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 EFDD1304BCC6\n\tfor <patchwork-incoming@ozlabs.org>; Tue, 31 Mar 2026 21:29:32 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id E2B76466B5B;\n\tTue, 31 Mar 2026 21:28: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 A305745BD4B;\n\tTue, 31 Mar 2026 21:28:53 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id D6AE7C4AF0B;\n\tTue, 31 Mar 2026 21:28:50 +0000 (UTC)" ], "ARC-Seal": [ "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1774992622; cv=pass;\n\tb=oHY2BBwtUaOTsev3HM8Ew8FIbJ7T8rSC9olDqbGigXf0COCSJYqvXJjp8+wFGV105KJUFh6JY4g8GIMVESmRcCRgVA+ZHPLiqpewidVYY897hl0CNjFXDFIjMYvCX/+YJ8Hho+caJWk0xiYxJffKyGS2jnCIdW/IvrCrchLMn/Y83/MBS1qQFZ8anKWl3ktln32JbjDi1jB0yrQCr8h2S3vg9sBQxixFpR+dLnLDQdlRA8/F2OgPQ3Qwg6h7Hn8cpXv4AKqPntEoGL7VhPRGRIQ008qZUwOhjj/j3Dqkx2RfsDURlibG4HNGqh7dMZpVLfdje/Z+TBFsKgOy5MXIuw==", "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774992533; cv=none;\n b=iKlFa6f/Ev1AXrxjPdxTI8Ov42qdfOqsAWb085iGT0Mw/mn4NJppBBc2KkGqhElfCY/PajkeMG4VeOdje/myMn5Qb9M8sYryTUG90Un/bOP4HqS9R8Arf1VVAj2khNqQvLA9retAnMsrd0apCtA54V+gG1UNalOKMXXmA5g0BO4=" ], "ARC-Message-Signature": [ "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1774992622; c=relaxed/relaxed;\n\tbh=2hkH9+lm9Y4HYlYKoFLZ09nzT0wEsUslnqPl8T73Kes=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=eFQHiRdirSM8Au7R8BANSf4T3U5M1fAIBaC/yaeookNvZUyZcP0kZxFQgni7vlZ81ITBsK3oRmCjo8BfMKAXbq0/ih6QsEX+JMEyWDjaBCHizSW4cch9+7RZ7MuUXZgrOtTYAnt4xDtucS1hE+KeskusWtVMYq61riePSR6FaP31ix+VAJ9ECOYY+IF2zPd/YhbVe00aO4h2gqQoefZdMgM0X0aZCtIFa8OdfRaBl2EHfbWPBKcwcO9UhPsc9aqzLUsXJ8xf0C/IS5UYV/fZjs7sMF3cW77J8zCHJR7xE3gqM71F+4KYY/BJqMPBIBmzsvIlYIde1nDQiDeE+cqMdQ==", "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774992533; c=relaxed/simple;\n\tbh=/diORXm8IGRtqDw2topSl4YhHdJWFeZU53slTSxgKHE=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=ldoSpzYQUXzX4hWn6+GQ460KyfAacL39WdUHK00aD/drtpJTgPcRvXytiIwozgh0Hb9PfSWgetQ9+DlGR/IWa952JdHbG+cK7laSDbo65Eiwz+KE9a72KlI8sDU7dQuMGoxRoLRBC7oesIwQrgutcovX+GBkEP4yAJRLB6uczP0=" ], "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=XO+aKq7H; dkim-atps=neutral;\n spf=pass (client-ip=172.232.135.74; helo=sto.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15553-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=XO+aKq7H; 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=1774992533;\n\tbh=/diORXm8IGRtqDw2topSl4YhHdJWFeZU53slTSxgKHE=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=XO+aKq7H3vM6HVnflCdGlpjB6v11YN7r3u7FMsm0NUUanMXBj16lBLuW1JnQduWRb\n\t s9OydeQdRgL+Jhz/YSz6RUheT2uxZ7WckZAqkWGB23Uq3qSgIGXFwrvZUsFveZWkU9\n\t vLCdwhI7Dk/1DumjH26ABMNh+Sz5mlQU+oFUzvBSFaYIqgMCJOadDG9XntcAwSIcgP\n\t YtJKYklxGLSJPeKEUutN1gUgEnCPDhtuyu1CD7NhNwGZklH2tTT1AP3scBlZifGdtj\n\t 4CljyRmEXQVegcaPtNoOAjCW8crvYDEBJB2Z1sDFaqKgTlv+iW7ouGjfq/n5KTPEED\n\t ujc5cOVDrn6hA==", "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 06/22] iomap: introduce IOMAP_F_FSVERITY and teach\n writeback to handle fsverity", "Date": "Tue, 31 Mar 2026 23:28:07 +0200", "Message-ID": "<20260331212827.2631020-7-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": "This flag indicates that I/O is for fsverity metadata.\n\nIn the write path skip i_size check and i_size updates as metadata is\npast EOF. In writeback don't update i_size and continue writeback if\neven folio is beyond EOF. In read path don't zero fsverity folios, again\nthey are past EOF.\n\nThe iomap_block_needs_zeroing() is also called from write path. For\nfolios of larger order we don't want to zero out pages in the folio as\nthese could contain other merkle tree blocks. For fsverity, filesystem\nwill request to read PAGE_SIZE memory regions. For data folios, iomap\nwill zero the rest of the folio for anything which is beyond EOF. We\ndon't want this for fsverity folios.\n\nSigned-off-by: Andrey Albershteyn <aalbersh@kernel.org>\nReviewed-by: \"Darrick J. Wong\" <djwong@kernel.org>\n---\n fs/iomap/buffered-io.c | 43 +++++++++++++++++++++++++++++++++---------\n fs/iomap/trace.h | 3 ++-\n include/linux/iomap.h | 8 ++++++++\n 3 files changed, 44 insertions(+), 10 deletions(-)", "diff": "diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c\nindex e4b6886e5c3c..a80fcb598cc8 100644\n--- a/fs/iomap/buffered-io.c\n+++ b/fs/iomap/buffered-io.c\n@@ -353,9 +353,26 @@ static inline bool iomap_block_needs_zeroing(const struct iomap_iter *iter,\n {\n \tconst struct iomap *srcmap = iomap_iter_srcmap(iter);\n \n-\treturn srcmap->type != IOMAP_MAPPED ||\n-\t\t(srcmap->flags & IOMAP_F_NEW) ||\n-\t\tpos >= i_size_read(iter->inode);\n+\t/*\n+\t * If this block has not been written, there's nothing to read\n+\t */\n+\tif (srcmap->type != IOMAP_MAPPED)\n+\t\treturn true;\n+\n+\t/*\n+\t * Newly allocated blocks have not been written\n+\t */\n+\tif (srcmap->flags & IOMAP_F_NEW)\n+\t\treturn true;\n+\n+\t/*\n+\t * fsverity metadata is stored past i_size, we need to read it instead of\n+\t * zeroing\n+\t */\n+\tif (srcmap->flags & IOMAP_F_FSVERITY)\n+\t\treturn false;\n+\n+\treturn pos >= i_size_read(iter->inode);\n }\n \n /**\n@@ -1167,13 +1184,14 @@ static int iomap_write_iter(struct iomap_iter *iter, struct iov_iter *i,\n \t\t * unlock and release the folio.\n \t\t */\n \t\told_size = iter->inode->i_size;\n-\t\tif (pos + written > old_size) {\n+\t\tif (pos + written > old_size &&\n+\t\t !(iter->iomap.flags & IOMAP_F_FSVERITY)) {\n \t\t\ti_size_write(iter->inode, pos + written);\n \t\t\titer->iomap.flags |= IOMAP_F_SIZE_CHANGED;\n \t\t}\n \t\t__iomap_put_folio(iter, write_ops, written, folio);\n \n-\t\tif (old_size < pos)\n+\t\tif (old_size < pos && !(iter->iomap.flags & IOMAP_F_FSVERITY))\n \t\t\tpagecache_isize_extended(iter->inode, old_size, pos);\n \n \t\tcond_resched();\n@@ -1801,13 +1819,20 @@ static int iomap_writeback_range(struct iomap_writepage_ctx *wpc,\n * Check interaction of the folio with the file end.\n *\n * If the folio is entirely beyond i_size, return false. If it straddles\n- * i_size, adjust end_pos and zero all data beyond i_size.\n+ * i_size, adjust end_pos and zero all data beyond i_size. Don't skip fsverity\n+ * folios as those are beyond i_size.\n */\n-static bool iomap_writeback_handle_eof(struct folio *folio, struct inode *inode,\n-\t\tu64 *end_pos)\n+static bool iomap_writeback_handle_eof(struct folio *folio,\n+\t\tstruct iomap_writepage_ctx *wpc, u64 *end_pos)\n {\n+\tstruct inode *inode = wpc->inode;\n \tu64 isize = i_size_read(inode);\n \n+\tif (wpc->iomap.flags & IOMAP_F_FSVERITY) {\n+\t\tWARN_ON_ONCE(folio_pos(folio) < isize);\n+\t\treturn true;\n+\t}\n+\n \tif (*end_pos > isize) {\n \t\tsize_t poff = offset_in_folio(folio, isize);\n \t\tpgoff_t end_index = isize >> PAGE_SHIFT;\n@@ -1873,7 +1898,7 @@ int iomap_writeback_folio(struct iomap_writepage_ctx *wpc, struct folio *folio)\n \n \ttrace_iomap_writeback_folio(inode, pos, folio_size(folio));\n \n-\tif (!iomap_writeback_handle_eof(folio, inode, &end_pos))\n+\tif (!iomap_writeback_handle_eof(folio, wpc, &end_pos))\n \t\treturn 0;\n \tWARN_ON_ONCE(end_pos <= pos);\n \ndiff --git a/fs/iomap/trace.h b/fs/iomap/trace.h\nindex 532787277b16..5252051cc137 100644\n--- a/fs/iomap/trace.h\n+++ b/fs/iomap/trace.h\n@@ -118,7 +118,8 @@ DEFINE_RANGE_EVENT(iomap_zero_iter);\n \t{ IOMAP_F_ATOMIC_BIO,\t\"ATOMIC_BIO\" }, \\\n \t{ IOMAP_F_PRIVATE,\t\"PRIVATE\" }, \\\n \t{ IOMAP_F_SIZE_CHANGED,\t\"SIZE_CHANGED\" }, \\\n-\t{ IOMAP_F_STALE,\t\"STALE\" }\n+\t{ IOMAP_F_STALE,\t\"STALE\" }, \\\n+\t{ IOMAP_F_FSVERITY,\t\"FSVERITY\" }\n \n \n #define IOMAP_DIO_STRINGS \\\ndiff --git a/include/linux/iomap.h b/include/linux/iomap.h\nindex 531f9ebdeeae..4506a99d5285 100644\n--- a/include/linux/iomap.h\n+++ b/include/linux/iomap.h\n@@ -87,6 +87,14 @@ struct vm_fault;\n #define IOMAP_F_INTEGRITY\t0\n #endif /* CONFIG_BLK_DEV_INTEGRITY */\n \n+/*\n+ * Indicates reads and writes of fsverity metadata.\n+ *\n+ * Fsverity metadata is stored after the regular file data and thus beyond\n+ * i_size.\n+ */\n+#define IOMAP_F_FSVERITY\t(1U << 10)\n+\n /*\n * Flag reserved for file system specific usage\n */\n", "prefixes": [ "v6", "06/22" ] }