get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2218288,
    "url": "http://patchwork.ozlabs.org/api/patches/2218288/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260331212827.2631020-15-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-15-aalbersh@kernel.org>",
    "list_archive_url": null,
    "date": "2026-03-31T21:28:15",
    "name": "[v6,14/22] xfs: use read ioend for fsverity data verification",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "da3452660d2a19900f7736c11eb6b4e44ee16b63",
    "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-15-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/2218288/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2218288/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <SRS0=qyk1=B7=vger.kernel.org=linux-ext4+bounces-15561-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=KBjsXKCn;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=150.107.74.76; helo=mail.ozlabs.org;\n envelope-from=srs0=qyk1=b7=vger.kernel.org=linux-ext4+bounces-15561-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=KBjsXKCn;\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-15561-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=\"KBjsXKCn\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"
        ],
        "Received": [
            "from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76])\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 4flhD20wPVz1yFv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 08:32:34 +1100 (AEDT)",
            "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4flhD20QSGz4wGT\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 08:32:34 +1100 (AEDT)",
            "by gandalf.ozlabs.org (Postfix)\n\tid 4flhD20KkYz58dR; Wed, 01 Apr 2026 08:32:34 +1100 (AEDT)",
            "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 4flhCy3rH2z4wGT\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 01 Apr 2026 08:32:30 +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 9F48630022E8\n\tfor <patchwork-incoming@ozlabs.org>; Tue, 31 Mar 2026 21:30:45 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id C753D4657E8;\n\tTue, 31 Mar 2026 21:29:17 +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 8114945BD57;\n\tTue, 31 Mar 2026 21:29:17 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id B3E37C19423;\n\tTue, 31 Mar 2026 21:29:14 +0000 (UTC)"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1774992754; cv=pass;\n\tb=D/GvgQbvAPF+5TpUMl6E5xoI80vLm8USXOyOB2RPdnrk6pB8XCNd6ibGtt+1S1D6VMVfnsIFvPDZSHx9uKYN+Tmo2IsyIrr8HONQ+742JWcZyPnX0UyFU3SrsguPTD1vhQk3auHb/A2bvjnG61CEEEoEiNaWS0p2WFF1Io+UWoyiC/kCSp94El0SpMxFjD14qCRH/9WZebo9PEBIkkW5d3Lglh47HE5AiEJsVrnXH98VXph0Vyut1w+JR7LxJHNNAd5ySkptFTctNDnAp9wCwKAxog9+JmWq/YEBzrKrhJR+E7wT9wsNS6WcK9m85GZ0L8Rjh76vcixwtS7RXbVgNg==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774992557; cv=none;\n b=gZbrfKRwOi8NC4Dl1NA9B1hiLCm1a4j0EyQ4O7hHcnYwVMEo60Hq7MMUYGidNw02CteChJ4KJbmB1rKT7arnW+xPFxadV5GjHsPyBfjc9q6xu18vuHD1XReTYGOQQpKkBpD8MS3hO6OVivrjOjphocen7PU2G3vmVKPERYnjrNQ="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1774992754; c=relaxed/relaxed;\n\tbh=jfhdibajfyDgmm3DTUFvDfmiDHT7Itk1EbA9JvtXVYM=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=h0Ffdcc1LaYJysq05cLD/F+GMGd6SbkCaDpN+Ks3VQUAUeOYTx1Glc+M41FGXNrCtjuZJRnmXpHnO48LKQAhrhHY4w8LQ+FEoAelgUCtZ2PYJiMhCIs/6aiqFCN0iNNKC0QTNkkEncPdHXGuav3yF6RhYPzD/sLL8WITNyWfOeitxe2OdpnfteJCrXYjmXIxy1rL8OWUe1oUWf3KDSu7a89EJNZ+AMqdZMcXyPf4fgXSd7lY0HGgJkhGe3vREYe1J81nif5qkdHDvNBaCP8X6DEEmS+C+Sk2eCJQaKSP2KEWiZRDxbS1MVmltDGlS9yLq55+IbrN9HbpKaa1pTCyEg==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774992557; c=relaxed/simple;\n\tbh=N+ltPut8pvS0sQ2uNYIbtBoWLwW+zdRDc+o9SproyBk=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=gdNmYj6HLOl/tgeLFq10c9zX+DZiJHp0idbbjpiKqCmjzco7bNkim7dQRWYrCTh6CUPhRBSshyREGAzz6o6232jSw46wPCyIaRePhLzgEI9kdb+thMZ/mXhPAy+odH+csBhrlpnhEHSikl7lp2YWX8UM+rXdhVMM+pa5uUJxy2U="
        ],
        "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=KBjsXKCn; 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-15561-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=KBjsXKCn; 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=1774992557;\n\tbh=N+ltPut8pvS0sQ2uNYIbtBoWLwW+zdRDc+o9SproyBk=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=KBjsXKCnNPBDLs+eDcnaVQ5J4nDlvf2iEnolFGb9gQ7msyTM/6AFGz8ol0hbNCbos\n\t SvICGQPgIVFTxRVSDSFyNunq3hiBqrHWOs16pnzoxfNVNm7RIZe0Hn9JKq5xWaWy0V\n\t BkhNUtqX8cTV7b5+AagF8b0m8mXxXxtZ1DC+z4VYGjpjV2cm2h6Ll43vgDmzPvK8H8\n\t q9zNfm0p+ScXAq01w+hWlhcb7xmzDuW04kTiUqX3uTRaam+wVLRGdJQ6MzXwxgSBi3\n\t 9YUV1gimMf4vmdkLyU15dgjdqWPa42BlR6q938yodbKDmy2EjQppjnTfVIYkMLCdT8\n\t u1INx6TSvhq7g==",
        "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 14/22] xfs: use read ioend for fsverity data verification",
        "Date": "Tue, 31 Mar 2026 23:28:15 +0200",
        "Message-ID": "<20260331212827.2631020-15-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": "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>\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": [
        "v6",
        "14/22"
    ]
}