get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2225140,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2225140/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260420114714.1621982-16-aalbersh@kernel.org/",
    "project": {
        "id": 8,
        "url": "http://patchwork.ozlabs.org/api/1.1/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
    },
    "msgid": "<20260420114714.1621982-16-aalbersh@kernel.org>",
    "date": "2026-04-20T11:47:02",
    "name": "[v8,15/22] xfs: use read ioend for fsverity data verification",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "da3452660d2a19900f7736c11eb6b4e44ee16b63",
    "submitter": {
        "id": 92821,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/92821/?format=api",
        "name": "Andrey Albershteyn",
        "email": "aalbersh@kernel.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260420114714.1621982-16-aalbersh@kernel.org/mbox/",
    "series": [
        {
            "id": 500600,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/500600/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/list/?series=500600",
            "date": "2026-04-20T11:46:51",
            "name": "fs-verity support for XFS with post EOF merkle tree",
            "version": 8,
            "mbox": "http://patchwork.ozlabs.org/series/500600/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2225140/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2225140/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <SRS0=TRDF=CT=vger.kernel.org=linux-ext4+bounces-15928-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=toUozB4+;\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=trdf=ct=vger.kernel.org=linux-ext4+bounces-15928-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)",
            "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=\"2600:3c0a:e001:db::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=toUozB4+;\n\tdkim-atps=neutral",
            "gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15928-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=\"toUozB4+\"",
            "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 4fzkTJ2Y4Jz1yGs\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 20 Apr 2026 21:55:48 +1000 (AEST)",
            "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4fzkTJ25M7z4wCp\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 20 Apr 2026 21:55:48 +1000 (AEST)",
            "by gandalf.ozlabs.org (Postfix)\n\tid 4fzkTJ1yrRz4wG9; Mon, 20 Apr 2026 21:55:48 +1000 (AEST)",
            "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby gandalf.ozlabs.org (Postfix) with ESMTPS id 4fzkTD5dZXz4wCp\n\tfor <patchwork-incoming@ozlabs.org>; Mon, 20 Apr 2026 21:55:44 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 49BF930B7906\n\tfor <patchwork-incoming@ozlabs.org>; Mon, 20 Apr 2026 11:48:30 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 845A739EF22;\n\tMon, 20 Apr 2026 11:48:20 +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 429AA3128B8;\n\tMon, 20 Apr 2026 11:48:20 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id 5F450C19425;\n\tMon, 20 Apr 2026 11:48:17 +0000 (UTC)"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1776686148; cv=pass;\n\tb=Vo3qIGHSlIiQCMEVb/dkcWSDxuA/+2/5UtZLjLp3QMFYHexg8gbO2tzouO8i6bxS9bRlOhTbjkIHernCzuAe/n1oemNfcnVOi/p8cCQGMss1uuTR6kPUZlynpbOjBfx8TT57iJTIVtCfzJa8mm+N9qc5O1djQwtXVcbXl6aF0OUYcE/KhnISaa1Y1fcvFT79pchOktjK8tDN8zGspICOEEwl/Qq5uW13GnNpjFAQAlMxIbUF7/iqvvyIGVXYoTIxq/44wlD6UuPdguEo+w0sqCuOaEGA/sD8G2SV+MDYIGq1aTo96VBMQUcUvrvBwOTXKU+oZZ7igDRdphVJnzimkg==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776685700; cv=none;\n b=Nx4JULykxVuYVWSOhwrTT26XAiahqUUs1wP4ywxEdVdskRTsp2nELxhHcc5PMUo1EZjlR0CP0N0uJkmAFDxPpJVaiYHyroO/jWMusFHSfCTSb9fFGV8HtSz2Zui9ljWWJUBrVC8uni+apPjrCBX07RcslZ+5BI1M/11VPCkaRmk="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1776686148; c=relaxed/relaxed;\n\tbh=lWM0vfhRoQN3XUnUh/hfhcB8qeHDbNjCnEWLhHQ7Rno=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=YZShrucO/e9KCKlFAwFyHoBt79Sg5giUoh6/ofQCeLPXq9eZtwusadur6DVzLNg35VBHUNBtfcuHhT7n24DvL0yA3loLLQBO5WGD5JzVEqH0tkJqBwZNp0rApBXffh6+rXNcOSYXHRuGFTo2rOeb7v3DBZS6RN3zsprSAJahIc5aM5S6S0xm81NQEO5WAl/QpvDDj/CzqilNsU3I3YvzwsOcyNMNLdqutBW+/GDTsEVoOIkrO7fOf9rIYYyXPSa0lAeomAmkQFOXV2OjZaEW5CBwqiZExN1N4Fg6OA/ZQnUKXZGKoFM6GMmiQMdFvekgPcvT/Ihd7P4FJW+h4T/PKg==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776685700; c=relaxed/simple;\n\tbh=+IPCnfTbYJgst2p5FA7yf8LN40/02HKXVjwkca7X0i4=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=Z5STfn/EFR5+rxXflzihrdrRgVyC++jdHuhRzji4DxoijSxFlyax9Oo9G714rhq5PyYTQWApLLUqtrbkbwqOBxx8d9XlfIpCzH1AQlIYRpmOoygu8trpy9vxGA6YY0Ilu8FUa76R+iFxkIciAtXq5S/vRM+uukv1x4PuCdyzCag="
        ],
        "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=toUozB4+; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15928-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=toUozB4+; 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=1776685699;\n\tbh=+IPCnfTbYJgst2p5FA7yf8LN40/02HKXVjwkca7X0i4=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=toUozB4+1Ug3agkeYQLjN6xd3KDnz9S/ATzZhEFhQuCFzumpF3AsQ2JDqwiRZp3wc\n\t RBH5sqCxurqETYwmgpEHgseIM9JvJCXiABVOxekgqm71yTcCb3/WI2on13Iqu3LwU4\n\t /t7ZgjMEtOJ9hRtvTO10T4pocWwHAA7lzhafj4Si6Cv8buImWmwJE9ZYZ8FZgBiZK/\n\t KSE8bqc+2ezj5UhxelDPc4SiV6YJs9wFYrKQPFSlQL3wJf2nSOztGEj7EVNc5eSGkr\n\t 4YSghm64nDTLe2Juvx6UeENeSOYUux5Eu1s1f7vZjziU+JuvL8ODAXqu3pk99rM5J1\n\t EtToxB9BhKx7w==",
        "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\tlinux-unionfs@vger.kernel.org,\n\tdjwong@kernel.org",
        "Subject": "[PATCH v8 15/22] xfs: use read ioend for fsverity data verification",
        "Date": "Mon, 20 Apr 2026 13:47:02 +0200",
        "Message-ID": "<20260420114714.1621982-16-aalbersh@kernel.org>",
        "X-Mailer": "git-send-email 2.51.2",
        "In-Reply-To": "<20260420114714.1621982-1-aalbersh@kernel.org>",
        "References": "<20260420114714.1621982-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": "Use read ioends for fsverity verification. Do not issues fsverity\nmetadata I/O through the same workqueue due to risk of a deadlock by a\nfilled workqueue.\n\nPass fsverity_info from iomap context down to the ioend as hashtable\nlookups are expensive.\n\nAdd a simple helper to check that this is not fsverity metadata but file\ndata that needs verification.\n\nReviewed-by: Christoph Hellwig <hch@lst.de>\nReviewed-by: Darrick J. Wong <djwong@kernel.org>\nSigned-off-by: Andrey Albershteyn <aalbersh@kernel.org>\n---\n fs/xfs/xfs_aops.c     | 46 ++++++++++++++++++++++++++++++++++---------\n fs/xfs/xfs_fsverity.c |  9 +++++++++\n fs/xfs/xfs_fsverity.h |  6 ++++++\n 3 files changed, 52 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c\nindex 9503252a0fa4..ecb07f250956 100644\n--- a/fs/xfs/xfs_aops.c\n+++ b/fs/xfs/xfs_aops.c\n@@ -24,6 +24,7 @@\n #include \"xfs_rtgroup.h\"\n #include \"xfs_fsverity.h\"\n #include <linux/bio-integrity.h>\n+#include <linux/fsverity.h>\n \n struct xfs_writepage_ctx {\n \tstruct iomap_writepage_ctx ctx;\n@@ -171,6 +172,23 @@ xfs_end_ioend_write(\n \tmemalloc_nofs_restore(nofs_flag);\n }\n \n+/*\n+ * IO read completion.\n+ */\n+static void\n+xfs_end_ioend_read(\n+\tstruct iomap_ioend\t*ioend)\n+{\n+\tstruct xfs_inode\t*ip = XFS_I(ioend->io_inode);\n+\n+\tif (!ioend->io_bio.bi_status &&\n+\t\t\txfs_fsverity_is_file_data(ip, ioend->io_offset))\n+\t\tfsverity_verify_bio(ioend->io_vi,\n+\t\t\t\t    &ioend->io_bio);\n+\tiomap_finish_ioends(ioend,\n+\t\tblk_status_to_errno(ioend->io_bio.bi_status));\n+}\n+\n /*\n  * Finish all pending IO completions that require transactional modifications.\n  *\n@@ -205,8 +223,7 @@ xfs_end_io(\n \t\tlist_del_init(&ioend->io_list);\n \t\tiomap_ioend_try_merge(ioend, &tmp);\n \t\tif (bio_op(&ioend->io_bio) == REQ_OP_READ)\n-\t\t\tiomap_finish_ioends(ioend,\n-\t\t\t\tblk_status_to_errno(ioend->io_bio.bi_status));\n+\t\t\txfs_end_ioend_read(ioend);\n \t\telse\n \t\t\txfs_end_ioend_write(ioend);\n \t\tcond_resched();\n@@ -232,9 +249,14 @@ xfs_end_bio(\n \t}\n \n \tspin_lock_irqsave(&ip->i_ioend_lock, flags);\n-\tif (list_empty(&ip->i_ioend_list))\n-\t\tWARN_ON_ONCE(!queue_work(mp->m_unwritten_workqueue,\n+\tif (list_empty(&ip->i_ioend_list)) {\n+\t\tif (IS_ENABLED(CONFIG_FS_VERITY) && ioend->io_vi &&\n+\t\t    ioend->io_offset < xfs_fsverity_metadata_offset(ip))\n+\t\t\tfsverity_enqueue_verify_work(&ip->i_ioend_work);\n+\t\telse\n+\t\t\tWARN_ON_ONCE(!queue_work(mp->m_unwritten_workqueue,\n \t\t\t\t\t &ip->i_ioend_work));\n+\t}\n \tlist_add_tail(&ioend->io_list, &ip->i_ioend_list);\n \tspin_unlock_irqrestore(&ip->i_ioend_lock, flags);\n }\n@@ -764,9 +786,13 @@ xfs_bio_submit_read(\n \tstruct iomap_read_folio_ctx\t*ctx)\n {\n \tstruct bio\t\t\t*bio = ctx->read_ctx;\n+\tstruct iomap_ioend\t\t*ioend;\n \n \t/* defer read completions to the ioend workqueue */\n-\tiomap_init_ioend(iter->inode, bio, ctx->read_ctx_file_offset, 0);\n+\tioend = iomap_init_ioend(iter->inode, bio, ctx->read_ctx_file_offset,\n+\t\t\t0);\n+\tioend->io_vi = ctx->vi;\n+\n \tbio->bi_end_io = xfs_end_bio;\n \tsubmit_bio(bio);\n }\n@@ -779,11 +805,13 @@ static const struct iomap_read_ops xfs_iomap_read_ops = {\n \n static inline const struct iomap_read_ops *\n xfs_get_iomap_read_ops(\n-\tconst struct address_space\t*mapping)\n+\tconst struct address_space\t*mapping,\n+\tloff_t\t\t\t\tposition)\n {\n \tstruct xfs_inode\t\t*ip = XFS_I(mapping->host);\n \n-\tif (bdev_has_integrity_csum(xfs_inode_buftarg(ip)->bt_bdev))\n+\tif (bdev_has_integrity_csum(xfs_inode_buftarg(ip)->bt_bdev) ||\n+\t\t\txfs_fsverity_is_file_data(ip, position))\n \t\treturn &xfs_iomap_read_ops;\n \treturn &iomap_bio_read_ops;\n }\n@@ -795,7 +823,7 @@ xfs_vm_read_folio(\n {\n \tstruct iomap_read_folio_ctx\tctx = { .cur_folio = folio };\n \n-\tctx.ops = xfs_get_iomap_read_ops(folio->mapping);\n+\tctx.ops = xfs_get_iomap_read_ops(folio->mapping, folio_pos(folio));\n \tiomap_read_folio(&xfs_read_iomap_ops, &ctx, NULL);\n \treturn 0;\n }\n@@ -806,7 +834,7 @@ xfs_vm_readahead(\n {\n \tstruct iomap_read_folio_ctx\tctx = { .rac = rac };\n \n-\tctx.ops = xfs_get_iomap_read_ops(rac->mapping),\n+\tctx.ops = xfs_get_iomap_read_ops(rac->mapping, readahead_pos(rac));\n \tiomap_readahead(&xfs_read_iomap_ops, &ctx, NULL);\n }\n \ndiff --git a/fs/xfs/xfs_fsverity.c b/fs/xfs/xfs_fsverity.c\nindex 6e6a8636a577..b983e20bb5e1 100644\n--- a/fs/xfs/xfs_fsverity.c\n+++ b/fs/xfs/xfs_fsverity.c\n@@ -19,3 +19,12 @@ xfs_fsverity_metadata_offset(\n {\n \treturn round_up(i_size_read(VFS_IC(ip)), XFS_FSVERITY_START_ALIGN);\n }\n+\n+bool\n+xfs_fsverity_is_file_data(\n+\tconst struct xfs_inode\t*ip,\n+\tloff_t\t\t\toffset)\n+{\n+\treturn fsverity_active(VFS_IC(ip)) &&\n+\t\t\toffset < xfs_fsverity_metadata_offset(ip);\n+}\ndiff --git a/fs/xfs/xfs_fsverity.h b/fs/xfs/xfs_fsverity.h\nindex 5771db2cd797..ec77ba571106 100644\n--- a/fs/xfs/xfs_fsverity.h\n+++ b/fs/xfs/xfs_fsverity.h\n@@ -9,12 +9,18 @@\n \n #ifdef CONFIG_FS_VERITY\n loff_t xfs_fsverity_metadata_offset(const struct xfs_inode *ip);\n+bool xfs_fsverity_is_file_data(const struct xfs_inode *ip, loff_t offset);\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+static inline bool xfs_fsverity_is_file_data(const struct xfs_inode *ip,\n+\t\t\t\t\t    loff_t offset)\n+{\n+\treturn false;\n+}\n #endif\t/* CONFIG_FS_VERITY */\n \n #endif\t/* __XFS_FSVERITY_H__ */\n",
    "prefixes": [
        "v8",
        "15/22"
    ]
}