get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2226022,
    "url": "http://patchwork.ozlabs.org/api/patches/2226022/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260422021042.4157510-15-yi.zhang@huaweicloud.com/",
    "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": "<20260422021042.4157510-15-yi.zhang@huaweicloud.com>",
    "list_archive_url": null,
    "date": "2026-04-22T02:10:34",
    "name": "[v3,14/22] ext4: implement partial block zero range path using iomap",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "36d89e089318b057a4df7c7e472b0b1380f31b25",
    "submitter": {
        "id": 85428,
        "url": "http://patchwork.ozlabs.org/api/people/85428/?format=api",
        "name": "Zhang Yi",
        "email": "yi.zhang@huaweicloud.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260422021042.4157510-15-yi.zhang@huaweicloud.com/mbox/",
    "series": [
        {
            "id": 500911,
            "url": "http://patchwork.ozlabs.org/api/series/500911/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/list/?series=500911",
            "date": "2026-04-22T02:10:23",
            "name": "ext4: use iomap for regular file's buffered I/O path",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/500911/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2226022/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2226022/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <SRS0=DoOU=CV=vger.kernel.org=linux-ext4+bounces-15985-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 spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=150.107.74.76; helo=mail.ozlabs.org;\n envelope-from=srs0=doou=cv=vger.kernel.org=linux-ext4+bounces-15985-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)",
            "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=172.105.105.114 arc.chain=subspace.kernel.org",
            "gandalf.ozlabs.org;\n dmarc=none (p=none dis=none) header.from=huaweicloud.com",
            "gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.105.105.114; helo=tor.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15985-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=45.249.212.51",
            "smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=huaweicloud.com",
            "smtp.subspace.kernel.org;\n spf=none smtp.mailfrom=huaweicloud.com"
        ],
        "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 4g0jhR100vz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 12:23:51 +1000 (AEST)",
            "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4g0jhR0Z1Hz4w1l\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 12:23:51 +1000 (AEST)",
            "by gandalf.ozlabs.org (Postfix)\n\tid 4g0jhR0TrHz4wK3; Wed, 22 Apr 2026 12:23:51 +1000 (AEST)",
            "from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])\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 4g0jhM54C5z4w1l\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 22 Apr 2026 12:23:47 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id BB79830ABFAA\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 22 Apr 2026 02:18:23 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 84F8E37D11C;\n\tWed, 22 Apr 2026 02:17:09 +0000 (UTC)",
            "from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com\n [45.249.212.51])\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 8D4D535A3B8;\n\tWed, 22 Apr 2026 02:17:05 +0000 (UTC)",
            "from mail.maildlp.com (unknown [172.19.163.170])\n\tby dggsgout11.his.huawei.com (SkyGuard) with ESMTPS id 4g0jWM5fs7zYQtrV;\n\tWed, 22 Apr 2026 10:15:59 +0800 (CST)",
            "from mail02.huawei.com (unknown [10.116.40.252])\n\tby mail.maildlp.com (Postfix) with ESMTP id F22BB405D4;\n\tWed, 22 Apr 2026 10:16:56 +0800 (CST)",
            "from huaweicloud.com (unknown [10.50.85.155])\n\tby APP3 (Coremail) with SMTP id _Ch0CgB3JL6PL+hpqkgUBQ--.2635S18;\n\tWed, 22 Apr 2026 10:16:56 +0800 (CST)"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1776824631; cv=pass;\n\tb=n97cqd1GEIvhjrVfOZNQ4Cdd5oLLAmrvfrOz5rq+1uptfNRRUyQpqxVsu9to0zv+RecSjO80fJr6ge+ZsqtgF9DE0isj+Q/sIZ5IaWyvr5rFhkuq913gyCXzSrM8J3b8IfR7SqDOHzWrKmyi+xNNsHMz5xp78wIzMTMq1n79h49GfqyPK0c8xGEtlEPswXT38UcS6+VTZX4/4g36KkuV0mOf3p0QZ88eqUvTXrBdfKyFsyo9010z8/GOdNkNVthqD28K/hHAifnErcs7C4wH/cjUGNAFsmRz7jt7b8fP8N8neQL1WyxfWV9VjsKJ6MaM8PMaG/uh+HA1w9nW1LzL0w==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776824229; cv=none;\n b=JbeJ1FJfBMS3D7Jty1J9Mf5ANtOtamE39c5nqI3pwPw889K5JP51sLhaKubOINGP05YsAhGmjzj562XCbETfztZUG71qXSKJgzPzcR+2KzR6AMvnxcBDpXdsKb6BkpF51oeM6Yxatnuy4SxPtFt+H5UPdPPTrBFyY2AcUFGOW0A="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1776824631; c=relaxed/relaxed;\n\tbh=RFBo4pcp7iTvp0wSSv6ljb4dwb4SnjaLc42jUuo7G0s=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=jxQz/oNPP+wWG4TtIpgtiHEj+3+TiQmToFaWRSUO5Gsg91XUN9a5iFsU722ZAwb5frQEfoSBJ79DWCeucG9PoC9c4Y+x9t88d0M37Ij+bs14JPJQdnrA2ymXX98tuHjh2yGwei4Y+CDHawQojJFlb0U803CgohJLiTXuZWGC+CTTtf7LfTllN9Wk0TC9tA0qrGWzQhB7HmYl0UVnoBoWAVCXracF5F/g5otLvMrgnl12P09415WnbqHoPRcWiHsjfzaRQ60Dn3+KHGPp4+weKD26rOJrWuA3kp2FsuM1VfZx4kcEKkQ359rHyPWKx72BwQQy1mwYshd9sb4FkRNrUQ==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776824229; c=relaxed/simple;\n\tbh=xPnRnv2vLgfMgk2Egdli1mi1SjXfj3Qdi0qbTQSB6o0=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=ByxTK7/61RBHpja2hgTNU9ujgaUcTIRcKt/9UX/Nz7LrP4etbhgG1e3NtYMbFz1iComt33MSQwJQ5P2qGKiHfya+Lmar17LN6b2+1z9wXLLJ+XyZ68F5mi4EdhLCJMKWabqGX3jgBRDHkWrbjjG79GFLj+tRFLxHtgBduWE0vrM="
        ],
        "ARC-Authentication-Results": [
            "i=2; gandalf.ozlabs.org;\n dmarc=none (p=none dis=none) header.from=huaweicloud.com;\n spf=pass (client-ip=172.105.105.114; helo=tor.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15985-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org",
            "i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=huaweicloud.com;\n spf=none smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51"
        ],
        "From": "Zhang Yi <yi.zhang@huaweicloud.com>",
        "To": "linux-ext4@vger.kernel.org,\n\tlinux-fsdevel@vger.kernel.org",
        "Cc": "linux-kernel@vger.kernel.org,\n\ttytso@mit.edu,\n\tadilger.kernel@dilger.ca,\n\tlibaokun@linux.alibaba.com,\n\tjack@suse.cz,\n\tojaswin@linux.ibm.com,\n\tritesh.list@gmail.com,\n\tdjwong@kernel.org,\n\thch@infradead.org,\n\tyi.zhang@huawei.com,\n\tyi.zhang@huaweicloud.com,\n\tyizhang089@gmail.com,\n\tyangerkun@huawei.com,\n\tyukuai@fnnas.com",
        "Subject": "[PATCH v3 14/22] ext4: implement partial block zero range path using\n iomap",
        "Date": "Wed, 22 Apr 2026 10:10:34 +0800",
        "Message-ID": "<20260422021042.4157510-15-yi.zhang@huaweicloud.com>",
        "X-Mailer": "git-send-email 2.52.0",
        "In-Reply-To": "<20260422021042.4157510-1-yi.zhang@huaweicloud.com>",
        "References": "<20260422021042.4157510-1-yi.zhang@huaweicloud.com>",
        "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-CM-TRANSID": "_Ch0CgB3JL6PL+hpqkgUBQ--.2635S18",
        "X-Coremail-Antispam": "1UD129KBjvJXoW3WF13Kw1DKFWrXF48ZFyxKrg_yoW7WF1UpF\n\tWDK345Gr47Wry29w4ftFsrXr1Yk3WxtrW8Wry3Grn0v3s8XayxKF48GFyF93W5tw47Cw12\n\tqF4UtryxGF1UAa7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2\n\t9KBjDU0xBIdaVrnRJUUUmS14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0\n\trVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYI\n\tkIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2\n\tz4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F\n\t4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq\n\t3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7\n\tIYx2IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4U\n\tM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628vn2\n\tkIc2xKxwCY1x0262kKe7AKxVWUtVW8ZwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkE\n\tbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67\n\tAF67kF1VAFwI0_GFv_WrylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVW8JVW5JwCI\n\t42IY6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF\n\t4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8Jr0_Cr1UYxBI\n\tdaVFxhVjvjDU0xZFpf9x0JUWMKtUUUUU=",
        "X-CM-SenderInfo": "d1lo6xhdqjqx5xdzvxpfor3voofrz/",
        "X-Spam-Status": "No, score=-1.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDMARC_MISSING,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,\n\tSPF_HELO_NONE,SPF_PASS autolearn=disabled version=4.0.1",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"
    },
    "content": "From: Zhang Yi <yi.zhang@huawei.com>\n\nIntroduce a new iomap_ops instance, ext4_iomap_zero_ops, along with\next4_iomap_block_zero_range() to implement the iomap block zeroing range\nfor ext4. ext4_iomap_block_zero_range() invokes iomap_zero_range() and\npasses ext4_iomap_zero_begin() to locate and zero out a mapped partial\nblock or a dirty, unwritten partial block.\n\nNote that zeroing out under an active handle can cause deadlock since\nthe order of acquiring the folio lock and starting a handle is\ninconsistent with the iomap writeback procedure. Therefore,\next4_iomap_block_zero_range() cannot be called under an active handle,\nand we also cannot use data=order mode to ensure zeroed data to be\nunwritten back before updating i_disksize when performing post-EOF\nappend write or performing truncate up as well.\n\nSigned-off-by: Zhang Yi <yi.zhang@huawei.com>\n---\n fs/ext4/inode.c | 91 +++++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 91 insertions(+)",
    "diff": "diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c\nindex 26e1366b85fd..701b912db6fb 100644\n--- a/fs/ext4/inode.c\n+++ b/fs/ext4/inode.c\n@@ -4103,6 +4103,50 @@ static int ext4_iomap_buffered_da_write_end(struct inode *inode, loff_t offset,\n \treturn 0;\n }\n \n+static int ext4_iomap_zero_begin(struct inode *inode,\n+\t\tloff_t offset, loff_t length, unsigned int flags,\n+\t\tstruct iomap *iomap, struct iomap *srcmap)\n+{\n+\tstruct iomap_iter *iter = container_of(iomap, struct iomap_iter, iomap);\n+\tstruct ext4_map_blocks map;\n+\tu8 blkbits = inode->i_blkbits;\n+\tunsigned int iomap_flags = 0;\n+\tint ret;\n+\n+\tret = ext4_emergency_state(inode->i_sb);\n+\tif (unlikely(ret))\n+\t\treturn ret;\n+\n+\tif (WARN_ON_ONCE(!(flags & IOMAP_ZERO)))\n+\t\treturn -EINVAL;\n+\n+\tret = ext4_iomap_map_blocks(inode, offset, length, NULL, &map);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\n+\t/*\n+\t * Look up dirty folios for unwritten mappings within EOF. Providing\n+\t * this bypasses the flush iomap uses to trigger extent conversion\n+\t * when unwritten mappings have dirty pagecache in need of zeroing.\n+\t */\n+\tif (map.m_flags & EXT4_MAP_UNWRITTEN) {\n+\t\tloff_t offset = ((loff_t)map.m_lblk) << blkbits;\n+\t\tloff_t end = ((loff_t)map.m_lblk + map.m_len) << blkbits;\n+\n+\t\tiomap_fill_dirty_folios(iter, &offset, end, &iomap_flags);\n+\t\tif ((offset >> blkbits) < map.m_lblk + map.m_len)\n+\t\t\tmap.m_len = (offset >> blkbits) - map.m_lblk;\n+\t}\n+\n+\text4_set_iomap(inode, iomap, &map, offset, length, flags);\n+\tiomap->flags |= iomap_flags;\n+\n+\treturn 0;\n+}\n+\n+static const struct iomap_ops ext4_iomap_zero_ops = {\n+\t.iomap_begin = ext4_iomap_zero_begin,\n+};\n \n const struct iomap_ops ext4_iomap_buffered_write_ops = {\n \t.iomap_begin = ext4_iomap_buffered_write_begin,\n@@ -4609,6 +4653,47 @@ static int ext4_block_journalled_zero_range(struct inode *inode, loff_t from,\n \treturn err;\n }\n \n+static int ext4_block_iomap_zero_range(struct inode *inode, loff_t from,\n+\t\t\t\t       loff_t length, bool *did_zero,\n+\t\t\t\t       bool *zero_written)\n+{\n+\tint ret;\n+\n+\t/*\n+\t * Zeroing out under an active handle can cause deadlock since\n+\t * the order of acquiring the folio lock and starting a handle is\n+\t * inconsistent with the iomap writeback procedure.\n+\t */\n+\tif (WARN_ON_ONCE(ext4_handle_valid(journal_current_handle())))\n+\t\treturn -EINVAL;\n+\n+\t/* The zeroing scope should not extend across a block. */\n+\tif (WARN_ON_ONCE((from >> inode->i_blkbits) !=\n+\t\t\t ((from + length - 1) >> inode->i_blkbits)))\n+\t\treturn -EINVAL;\n+\n+\tif (!(EXT4_SB(inode->i_sb)->s_mount_state & EXT4_ORPHAN_FS) &&\n+\t    !(inode_state_read_once(inode) & (I_NEW | I_FREEING)))\n+\t\tWARN_ON_ONCE(!inode_is_locked(inode) &&\n+\t\t\t!rwsem_is_locked(&inode->i_mapping->invalidate_lock));\n+\n+\tret = iomap_zero_range(inode, from, length, did_zero,\n+\t\t\t       &ext4_iomap_zero_ops, &ext4_iomap_write_ops,\n+\t\t\t       NULL);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\t/*\n+\t * TODO: The iomap does not distinguish between different types of\n+\t * zeroing and always sets zero_written if a zeroing operation is\n+\t * performed, which may result in unnecessary order operations.\n+\t */\n+\tif (did_zero && zero_written)\n+\t\t*zero_written = *did_zero;\n+\n+\treturn 0;\n+}\n+\n /*\n  * Zeros out a mapping of length 'length' starting from file offset\n  * 'from'.  The range to be zero'd must be contained with in one block.\n@@ -4635,6 +4720,9 @@ static int ext4_block_zero_range(struct inode *inode,\n \t} else if (ext4_should_journal_data(inode)) {\n \t\treturn ext4_block_journalled_zero_range(inode, from, length,\n \t\t\t\t\t\t\tdid_zero);\n+\t} else if (ext4_inode_buffered_iomap(inode)) {\n+\t\treturn ext4_block_iomap_zero_range(inode, from, length,\n+\t\t\t\t\t\t   did_zero, zero_written);\n \t}\n \treturn ext4_block_do_zero_range(inode, from, length, did_zero,\n \t\t\t\t\tzero_written);\n@@ -4675,6 +4763,9 @@ int ext4_block_zero_eof(struct inode *inode, loff_t from, loff_t end)\n \t * truncating up or performing an append write, because there might be\n \t * exposing stale on-disk data which may caused by concurrent post-EOF\n \t * mmap write during folio writeback.\n+\t *\n+\t * TODO: In the iomap path, handle this by updating i_disksize to\n+\t * i_size after the zeroed data has been written back.\n \t */\n \tif (ext4_should_order_data(inode) &&\n \t    did_zero && zero_written && !IS_DAX(inode)) {\n",
    "prefixes": [
        "v3",
        "14/22"
    ]
}