get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2218303,
    "url": "http://patchwork.ozlabs.org/api/patches/2218303/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260331212827.2631020-6-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-6-aalbersh@kernel.org>",
    "list_archive_url": null,
    "date": "2026-03-31T21:28:06",
    "name": "[v6,05/22] fsverity: hoist pagecache_read from f2fs/ext4 to fsverity",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "7c4a7af0f87f71f4e09f701939957b461c16a7e9",
    "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-6-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/2218303/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2218303/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <SRS0=tR5C=B7=vger.kernel.org=linux-ext4+bounces-15552-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=rwNRpP7b;\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=tr5c=b7=vger.kernel.org=linux-ext4+bounces-15552-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)",
            "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=\"2600:3c15:e001:75::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=rwNRpP7b;\n\tdkim-atps=neutral",
            "gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15552-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=\"rwNRpP7b\"",
            "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 4flhVX1x2Mz1yFv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 08:45:07 +1100 (AEDT)",
            "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4flhVW0BMhz4wSQ\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 08:45:07 +1100 (AEDT)",
            "by gandalf.ozlabs.org (Postfix)\n\tid 4flhVV73QDz58dY; Wed, 01 Apr 2026 08:45:06 +1100 (AEDT)",
            "from sin.lore.kernel.org (sin.lore.kernel.org\n [IPv6:2600:3c15:e001:75::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 4flhVR3p5bz4wSQ\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 01 Apr 2026 08:45:03 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 14CAE30701F7\n\tfor <patchwork-incoming@ozlabs.org>; Tue, 31 Mar 2026 21:29:24 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id C3B7C4657F3;\n\tTue, 31 Mar 2026 21:28:50 +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 8429A3E5EF9;\n\tTue, 31 Mar 2026 21:28:50 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id 92FF5C19423;\n\tTue, 31 Mar 2026 21:28:47 +0000 (UTC)"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1774993506; cv=pass;\n\tb=AdNPkw51GsFbVyobMm35/u72EDPO5TkrZIdyQR2cnlRpqqI7Arhc6pm7gl4lPHDUJ/1A3zHxMYSJtBOqv0R1OUPphOHbSEQ0zbkAOm3gpR6V2kokJLeijk3Cek4MvCreA6zCSfL6/AcFuCwPTZQoAF68YTHLuEBb6dSglQoLm/VzEt2RMNXbOC3AaX6LQgH/Gl5HSZ8oyvEtfOBuNg8CKCOtIqf6PRsiiB+zyJ5XUfUUJFM0hq5zNfa85EzmlJYMnXoDWGyJeuqtltvA9rRpGbm7zuahGQSLONJGyVe0djOpIZOza/U6IpxSmTOJhxMFcQcSypX/lE0tsw1aLfPfAA==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774992530; cv=none;\n b=GdwxJEoJ6PT/qYl8hsy3LDpncOJdvfVWjAP2GBc7avudLkZW+wfsYv+1zwzoHWDBixTGHf0JEJ5IN0CQigmmwuA/ssdf/qPIHx2wbqplmAlKzGVfiRoxLCXqhnTqXplb6/eorieqbrKEw8vVW6dn4mrAZYCLF8Wqt8hJA+UgWME="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1774993506; c=relaxed/relaxed;\n\tbh=SaeS6ez4Zxz3OEJyihDmdT79+b0ImcO6EZJQfkg2CVs=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=AVuJbXf6dmeE2T1kcBKQy1KGy42vFbOvCb7qDbZ2u7kEh4isSh5bdakkTDbYxEFpZTpAlvVRbihAS2eTCPHdn9zK1LvhcJD8XfGjSCoO3W+xMA0S3uM4DlVrTkaHEhcCp5iVgEnYHvviWFEPSPnRP1wW9YXUHQJHijOQtlq5KHklzLDXi2JiEAtXls+YMDsI6QEvSguE92Eyl7yD/3Gim9BQWFGsaDn/OyO034KTa7LWecx3l6FSQDmIBN/5xxMR9PK2I9mFzDASyQKxtbQMiCnSk6/zV4lpqgFRpYMd9KIWDBQJol1F+MYwyVRKRfNdaetrWDnfFfC4Y094oAn4xQ==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774992530; c=relaxed/simple;\n\tbh=+3ok1373XIZuelq2UHQQLIGu/yCvKYaUMNt0uOZDvuc=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=ZhSvdyrpzHZ8o14E0T1y3yOHm/e+aVxthSJY0frVM0qnOH0czMHGO2vizQR6PnM2OtGqAo/XowLyqK2sASXMIVYdnjOc2Xa7DLW+GWiMG0yt/aa9a04+otBg7NuIZUtVdJzNf62WhUc/DpFo1bg0vv7RlG2SNdkVS/skpx3w/lw="
        ],
        "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=rwNRpP7b; dkim-atps=neutral;\n spf=pass (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15552-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=rwNRpP7b; 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=1774992530;\n\tbh=+3ok1373XIZuelq2UHQQLIGu/yCvKYaUMNt0uOZDvuc=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=rwNRpP7bug7OdD/gZoWJKA4cUiKpCSkiGSBRJLj1AUUJf5lKnHgnSZEDK/a67QS5Y\n\t CZpyqgpmbi02/oT4vFkGHwaGqZ1+BphS9CG2+tkqNt9f77QcbHwWRXtNji1qzJ3Q2O\n\t tCETIeFzI1QngYezS91YkjXMieXxcf/P8t0VGyIPJd57J6C9UBMvL1LM0SV0mSzRmY\n\t mAJ6MV8OOzNfwnT4rUG63kbaR3E4WMwbqbmO0VU5FAE0KMDnQtyXdnPTFjjgbVfwUc\n\t uQgzsXiK+oABYoz211C90yLNZMj8EulY8c/iKEwAWSkP2Z9zvy9lW1By5KpnGSQzS/\n\t BM0M0WU+RnMSA==",
        "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 05/22] fsverity: hoist pagecache_read from f2fs/ext4 to\n fsverity",
        "Date": "Tue, 31 Mar 2026 23:28:06 +0200",
        "Message-ID": "<20260331212827.2631020-6-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 is the same function to read from pageache. XFS will also need\nthis, so move this to core fsverity.\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/ext4/verity.c         | 32 +++-----------------------------\n fs/f2fs/verity.c         | 30 +-----------------------------\n fs/verity/pagecache.c    | 33 +++++++++++++++++++++++++++++++++\n include/linux/fsverity.h |  2 ++\n 4 files changed, 39 insertions(+), 58 deletions(-)",
    "diff": "diff --git a/fs/ext4/verity.c b/fs/ext4/verity.c\nindex 347945ac23a4..ac5c133f5529 100644\n--- a/fs/ext4/verity.c\n+++ b/fs/ext4/verity.c\n@@ -34,32 +34,6 @@ static inline loff_t ext4_verity_metadata_pos(const struct inode *inode)\n \treturn round_up(inode->i_size, 65536);\n }\n \n-/*\n- * Read some verity metadata from the inode.  __vfs_read() can't be used because\n- * we need to read beyond i_size.\n- */\n-static int pagecache_read(struct inode *inode, void *buf, size_t count,\n-\t\t\t  loff_t pos)\n-{\n-\twhile (count) {\n-\t\tstruct folio *folio;\n-\t\tsize_t n;\n-\n-\t\tfolio = read_mapping_folio(inode->i_mapping, pos >> PAGE_SHIFT,\n-\t\t\t\t\t NULL);\n-\t\tif (IS_ERR(folio))\n-\t\t\treturn PTR_ERR(folio);\n-\n-\t\tn = memcpy_from_file_folio(buf, folio, pos, count);\n-\t\tfolio_put(folio);\n-\n-\t\tbuf += n;\n-\t\tpos += n;\n-\t\tcount -= n;\n-\t}\n-\treturn 0;\n-}\n-\n /*\n  * Write some verity metadata to the inode for FS_IOC_ENABLE_VERITY.\n  * kernel_write() can't be used because the file descriptor is readonly.\n@@ -311,8 +285,8 @@ static int ext4_get_verity_descriptor_location(struct inode *inode,\n \t\tgoto bad;\n \tdesc_size_pos -= sizeof(desc_size_disk);\n \n-\terr = pagecache_read(inode, &desc_size_disk, sizeof(desc_size_disk),\n-\t\t\t     desc_size_pos);\n+\terr = fsverity_pagecache_read(inode, &desc_size_disk,\n+\t\t\t\t      sizeof(desc_size_disk), desc_size_pos);\n \tif (err)\n \t\treturn err;\n \tdesc_size = le32_to_cpu(desc_size_disk);\n@@ -352,7 +326,7 @@ static int ext4_get_verity_descriptor(struct inode *inode, void *buf,\n \tif (buf_size) {\n \t\tif (desc_size > buf_size)\n \t\t\treturn -ERANGE;\n-\t\terr = pagecache_read(inode, buf, desc_size, desc_pos);\n+\t\terr = fsverity_pagecache_read(inode, buf, desc_size, desc_pos);\n \t\tif (err)\n \t\t\treturn err;\n \t}\ndiff --git a/fs/f2fs/verity.c b/fs/f2fs/verity.c\nindex b3b3e71604ac..5ea0a9b40443 100644\n--- a/fs/f2fs/verity.c\n+++ b/fs/f2fs/verity.c\n@@ -36,34 +36,6 @@ static inline loff_t f2fs_verity_metadata_pos(const struct inode *inode)\n \treturn round_up(inode->i_size, 65536);\n }\n \n-/*\n- * Read some verity metadata from the inode.  __vfs_read() can't be used because\n- * we need to read beyond i_size.\n- */\n-static int pagecache_read(struct inode *inode, void *buf, size_t count,\n-\t\t\t  loff_t pos)\n-{\n-\twhile (count) {\n-\t\tsize_t n = min_t(size_t, count,\n-\t\t\t\t PAGE_SIZE - offset_in_page(pos));\n-\t\tstruct page *page;\n-\n-\t\tpage = read_mapping_page(inode->i_mapping, pos >> PAGE_SHIFT,\n-\t\t\t\t\t NULL);\n-\t\tif (IS_ERR(page))\n-\t\t\treturn PTR_ERR(page);\n-\n-\t\tmemcpy_from_page(buf, page, offset_in_page(pos), n);\n-\n-\t\tput_page(page);\n-\n-\t\tbuf += n;\n-\t\tpos += n;\n-\t\tcount -= n;\n-\t}\n-\treturn 0;\n-}\n-\n /*\n  * Write some verity metadata to the inode for FS_IOC_ENABLE_VERITY.\n  * kernel_write() can't be used because the file descriptor is readonly.\n@@ -248,7 +220,7 @@ static int f2fs_get_verity_descriptor(struct inode *inode, void *buf,\n \tif (buf_size) {\n \t\tif (size > buf_size)\n \t\t\treturn -ERANGE;\n-\t\tres = pagecache_read(inode, buf, size, pos);\n+\t\tres = fsverity_pagecache_read(inode, buf, size, pos);\n \t\tif (res)\n \t\t\treturn res;\n \t}\ndiff --git a/fs/verity/pagecache.c b/fs/verity/pagecache.c\nindex c338dfa3eb18..da8606d58637 100644\n--- a/fs/verity/pagecache.c\n+++ b/fs/verity/pagecache.c\n@@ -78,3 +78,36 @@ void fsverity_fill_zerohash(struct folio *folio, size_t poff, size_t plen,\n \t\t\t\tvi->tree_params.digest_size);\n }\n EXPORT_SYMBOL_GPL(fsverity_fill_zerohash);\n+\n+/**\n+ * fsverity_pagecache_read() - read page and copy data to buffer\n+ * @inode:\tcopy from this inode's address space\n+ * @buf:\tbuffer to copy to\n+ * @count:\tnumber of bytes to copy\n+ * @pos:\tposition of the folio to copy from\n+ *\n+ * Read some verity metadata from the inode.  __vfs_read() can't be used because\n+ * we need to read beyond i_size.\n+ */\n+int fsverity_pagecache_read(struct inode *inode, void *buf, size_t count,\n+\t\t\t  loff_t pos)\n+{\n+\twhile (count) {\n+\t\tstruct folio *folio;\n+\t\tsize_t n;\n+\n+\t\tfolio = read_mapping_folio(inode->i_mapping, pos >> PAGE_SHIFT,\n+\t\t\t\t\t NULL);\n+\t\tif (IS_ERR(folio))\n+\t\t\treturn PTR_ERR(folio);\n+\n+\t\tn = memcpy_from_file_folio(buf, folio, pos, count);\n+\t\tfolio_put(folio);\n+\n+\t\tbuf += n;\n+\t\tpos += n;\n+\t\tcount -= n;\n+\t}\n+\treturn 0;\n+}\n+EXPORT_SYMBOL_GPL(fsverity_pagecache_read);\ndiff --git a/include/linux/fsverity.h b/include/linux/fsverity.h\nindex 881db75f1cba..9a2f9c055a49 100644\n--- a/include/linux/fsverity.h\n+++ b/include/linux/fsverity.h\n@@ -339,5 +339,7 @@ void fsverity_cleanup_inode(struct inode *inode);\n struct page *generic_read_merkle_tree_page(struct inode *inode, pgoff_t index);\n void generic_readahead_merkle_tree(struct inode *inode, pgoff_t index,\n \t\t\t\t   unsigned long nr_pages);\n+int fsverity_pagecache_read(struct inode *inode, void *buf, size_t count,\n+\t\t\t    loff_t pos);\n \n #endif\t/* _LINUX_FSVERITY_H */\n",
    "prefixes": [
        "v6",
        "05/22"
    ]
}