get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2218283,
    "url": "http://patchwork.ozlabs.org/api/patches/2218283/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260331212827.2631020-4-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-4-aalbersh@kernel.org>",
    "list_archive_url": null,
    "date": "2026-03-31T21:28:04",
    "name": "[v6,03/22] fsverity: generate and store zero-block hash",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "e6cdc8fa74655a48ba85ea05170fb6e281634674",
    "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-4-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/2218283/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2218283/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <SRS0=ZvJz=B7=vger.kernel.org=linux-ext4+bounces-15550-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=c9qCzIF1;\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=zvjz=b7=vger.kernel.org=linux-ext4+bounces-15550-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=c9qCzIF1;\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-15550-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=\"c9qCzIF1\"",
            "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 server-signature ECDSA (secp384r1 raw public key)\n server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4flh8X6rsrz1yCp\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 08:29:32 +1100 (AEDT)",
            "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4flh8X3FdBz4wGx\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 08:29:32 +1100 (AEDT)",
            "by gandalf.ozlabs.org (Postfix)\n\tid 4flh8X39DLz4wTd; Wed, 01 Apr 2026 08:29:32 +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 4flh8S6NbNz4wGx\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 01 Apr 2026 08:29:28 +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 E606430255F4\n\tfor <patchwork-incoming@ozlabs.org>; Tue, 31 Mar 2026 21:29:05 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id A96DD4611C9;\n\tTue, 31 Mar 2026 21:28:44 +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 67D4F3AA1AF;\n\tTue, 31 Mar 2026 21:28:44 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id A1963C2BC9E;\n\tTue, 31 Mar 2026 21:28:41 +0000 (UTC)"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1774992572; cv=pass;\n\tb=Z/c+WoWAdxbgc3O6HKq+q8M9H7r9H+HbNpX/SgfjPDyG/Y2Ib8Bs5K5BBIZALuX8atTB/baYgW6QnKv1x69FD2sv5ZpIQ1YRNCeuybsblffdrPef+Cy+EMPNTGdXm3NNChLcfbwQIcMTscLXMYbA4rMZC5YqlOVcnjgXqY6nT8eLG4HFoudIp0fcT8kH22PRHs1wfJcWtOSxZkEG4dZUV01hfseNjNnNwZxMzQx5dBhbSH5neZnHPeS1B86c+qvbinNMHjGjVSJeYYuwwY6G0QUN+M1jEV1BzmeG9+ZVEgHCnwB60cib6ikxYpBrIE6P9TcU6R9tvLcJzxgaHcI29g==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774992524; cv=none;\n b=JVbipspS+VtoThp2akX2HdStOR5vuCfMEEeGRztJIvwrdfJZYlDqrbIEa3lj1cryGK+3gAbwmIR7lVgi3MXAMhK5MBw5M0OtWFvReiWqO0v+3koL/aVPWkolJ/sHwHr3y+hxXPqMo7C2pAou15Co7i2UlinbBAxfUFWXIkmO6R0="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1774992572; c=relaxed/relaxed;\n\tbh=tMhz/FhXef7bz6wNCOUXTi6zMRpw77BNiN+gGKqX50Q=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=GPTy+rX42ptwZtXmSehCvdp8ZqkLLCRoUi+iAZhmgUa1Nr4Ld1wmv0PjyLzQhYe2j6fXFqqQrhuVhrXW1/G8+UyWDEni1nWL7/YpE4YqGZCkN0cldn5ryXwIxu0mt3PraEOhHPYNCO8AGHGbquQGRWQtNFuAwcLN+kLBEA/lSliccvFaXcCyI4PTKgluzEGdb+w30Je1vNfVbDcrS/CKOvmOrIMdip90buHSpFbvPBKsPM6JHA9iGjEaOR6U+i1ZPiv8ZDYjDXHtqDNjSHTu2kS3/HmKeciP6VQnol1OYCt5f0xJmBkMOIlQfLhsn88vh5QyH5kUWg/CSWRcfRUpLA==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774992524; c=relaxed/simple;\n\tbh=QrRKSjhxHnv8f+YwIcIJjNn7C1rmXBKEk/PRnbjV/zM=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=ohgKcignVJdnUW6PnuFEPQtrI7sOEaOn2aPwOrtZ0D177S36SW5iPVVWspSogPjql4P4tUJRrHY7BQ8jNBHPPpJwL3vnimcO96mA143IVhj54+2+Gfzcbzavny/ZpNQFR78zQclm6Uor56ejIBvm412D52x/7yPqw4x6nrxHPSM="
        ],
        "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=c9qCzIF1; 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-15550-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=c9qCzIF1; 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=1774992524;\n\tbh=QrRKSjhxHnv8f+YwIcIJjNn7C1rmXBKEk/PRnbjV/zM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=c9qCzIF1hA694H6N7tfiudGv/gAw2vV3xHog5MtGQYffrTZ/ld6aqEK5oWcJjvAu2\n\t SwEph0VLLbn9EaEbZhgwonTV9YWyIdR5pZvF2Nxk2H09iDueVKXB3ocIfaSgIs+xP2\n\t BNMrXqkaRezDGAFETGpzOBUj7GWqopTxxM9uEdrdrUD1lSJrnSfcm4dEOkX/5oIjiC\n\t s3+VpEEHOIDuMw1QCLh7OEigWsSogHuRBgPMmc/Kkp1nxVxYUi7n44AWzcZkOf+jFX\n\t GLlshhkrI3kXBz/E62+0ZoWSxni5C4qXyyuio77Ks1RSDIB8cfMGK8J3HNbbtjdBd7\n\t kcDxs2occSwog==",
        "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 03/22] fsverity: generate and store zero-block hash",
        "Date": "Tue, 31 Mar 2026 23:28:04 +0200",
        "Message-ID": "<20260331212827.2631020-4-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": "Compute the hash of one filesystem block's worth of zeros. A filesystem\nimplementation can decide to elide merkle tree blocks containing only\nthis hash and synthesize the contents at read time.\n\nLet's pretend that there's a file containing six data blocks and whose\nmerkle tree looks roughly like this:\n\nroot\n +--leaf0\n |   +--data0\n |   +--data1\n |   `--data2\n `--leaf1\n     +--data3\n     +--data4\n     `--data5\n\nIf data[0-2] are sparse holes, then leaf0 will contain a repeating\nsequence of @zero_digest.  Therefore, leaf0 need not be written to disk\nbecause its contents can be synthesized.\n\nA subsequent xfs patch will use this to reduce the size of the merkle\ntree when dealing with sparse gold master disk images and the like.\n\nAdd a helper to pre-fill folio with hashes of empty blocks. This will be\nused by iomap to synthesize blocks full of zero hashes on the fly.\n\nSigned-off-by: Darrick J. Wong <djwong@kernel.org>\nSigned-off-by: Andrey Albershteyn <aalbersh@kernel.org>\n---\n fs/verity/fsverity_private.h |  3 +++\n fs/verity/open.c             |  3 +++\n fs/verity/pagecache.c        | 22 ++++++++++++++++++++++\n include/linux/fsverity.h     |  8 ++++++++\n 4 files changed, 36 insertions(+)",
    "diff": "diff --git a/fs/verity/fsverity_private.h b/fs/verity/fsverity_private.h\nindex 6e6854c19078..35636c1e2c41 100644\n--- a/fs/verity/fsverity_private.h\n+++ b/fs/verity/fsverity_private.h\n@@ -53,6 +53,9 @@ struct merkle_tree_params {\n \tu64 tree_size;\t\t\t/* Merkle tree size in bytes */\n \tunsigned long tree_pages;\t/* Merkle tree size in pages */\n \n+\t/* the hash of a merkle block-sized buffer of zeroes */\n+\tu8 zero_digest[FS_VERITY_MAX_DIGEST_SIZE];\n+\n \t/*\n \t * Starting block index for each tree level, ordered from leaf level (0)\n \t * to root level ('num_levels - 1')\ndiff --git a/fs/verity/open.c b/fs/verity/open.c\nindex 0483db672526..94407a37aa08 100644\n--- a/fs/verity/open.c\n+++ b/fs/verity/open.c\n@@ -153,6 +153,9 @@ int fsverity_init_merkle_tree_params(struct merkle_tree_params *params,\n \t\tgoto out_err;\n \t}\n \n+\tfsverity_hash_block(params, page_address(ZERO_PAGE(0)),\n+\t\t\t    params->zero_digest);\n+\n \tparams->tree_size = offset << log_blocksize;\n \tparams->tree_pages = PAGE_ALIGN(params->tree_size) >> PAGE_SHIFT;\n \treturn 0;\ndiff --git a/fs/verity/pagecache.c b/fs/verity/pagecache.c\nindex 1819314ecaa3..c338dfa3eb18 100644\n--- a/fs/verity/pagecache.c\n+++ b/fs/verity/pagecache.c\n@@ -2,6 +2,7 @@\n /*\n  * Copyright 2019 Google LLC\n  */\n+#include \"fsverity_private.h\"\n \n #include <linux/export.h>\n #include <linux/fsverity.h>\n@@ -56,3 +57,24 @@ void generic_readahead_merkle_tree(struct inode *inode, pgoff_t index,\n \t\tfolio_put(folio);\n }\n EXPORT_SYMBOL_GPL(generic_readahead_merkle_tree);\n+\n+/**\n+ * fsverity_fill_zerohash() - fill folio with hashes of zero data block\n+ * @folio:\tfolio to fill\n+ * @poff:\toffset in the folio to start\n+ * @plen:\tlength of the range to fill with hashes\n+ * @vi:\t\tfsverity info\n+ */\n+void fsverity_fill_zerohash(struct folio *folio, size_t poff, size_t plen,\n+\t\t\t      struct fsverity_info *vi)\n+{\n+\tsize_t offset = poff;\n+\n+\tWARN_ON_ONCE(!IS_ALIGNED(poff, vi->tree_params.digest_size));\n+\tWARN_ON_ONCE(!IS_ALIGNED(plen, vi->tree_params.digest_size));\n+\n+\tfor (; offset < (poff + plen); offset += vi->tree_params.digest_size)\n+\t\tmemcpy_to_folio(folio, offset, vi->tree_params.zero_digest,\n+\t\t\t\tvi->tree_params.digest_size);\n+}\n+EXPORT_SYMBOL_GPL(fsverity_fill_zerohash);\ndiff --git a/include/linux/fsverity.h b/include/linux/fsverity.h\nindex 2e3a90aff11e..03f703e5bb40 100644\n--- a/include/linux/fsverity.h\n+++ b/include/linux/fsverity.h\n@@ -201,6 +201,8 @@ bool fsverity_verify_blocks(struct fsverity_info *vi, struct folio *folio,\n \t\t\t    size_t len, size_t offset);\n void fsverity_verify_bio(struct fsverity_info *vi, struct bio *bio);\n void fsverity_enqueue_verify_work(struct work_struct *work);\n+void fsverity_fill_zerohash(struct folio *folio, size_t poff, size_t plen,\n+\t\t\t      struct fsverity_info *vi);\n \n #else /* !CONFIG_FS_VERITY */\n \n@@ -281,6 +283,12 @@ static inline void fsverity_enqueue_verify_work(struct work_struct *work)\n \tWARN_ON_ONCE(1);\n }\n \n+static inline void fsverity_fill_zerohash(struct folio *folio, size_t poff,\n+\t\tsize_t plen, struct fsverity_info *vi)\n+{\n+\tWARN_ON_ONCE(1);\n+}\n+\n #endif\t/* !CONFIG_FS_VERITY */\n \n static inline bool fsverity_verify_folio(struct fsverity_info *vi,\n",
    "prefixes": [
        "v6",
        "03/22"
    ]
}