get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2216844,
    "url": "http://patchwork.ozlabs.org/api/patches/2216844/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260327102939.1095257-3-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": "<20260327102939.1095257-3-yi.zhang@huaweicloud.com>",
    "list_archive_url": null,
    "date": "2026-03-27T10:29:28",
    "name": "[v4,02/13] ext4: rename and extend ext4_block_truncate_page()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "6dd40322a2ce468d57e60e319050573dac8b03d8",
    "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/20260327102939.1095257-3-yi.zhang@huaweicloud.com/mbox/",
    "series": [
        {
            "id": 497742,
            "url": "http://patchwork.ozlabs.org/api/series/497742/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/list/?series=497742",
            "date": "2026-03-27T10:29:26",
            "name": "ext4: refactor partial block zero-out for iomap conversion",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/497742/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2216844/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2216844/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <SRS0=3MyH=B3=vger.kernel.org=linux-ext4+bounces-15487-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=2404:9400:2221:ea00::3; helo=mail.ozlabs.org;\n envelope-from=srs0=3myh=b3=vger.kernel.org=linux-ext4+bounces-15487-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-15487-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=pass smtp.mailfrom=huaweicloud.com"
        ],
        "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 4fhy0V3C0Pz1y1j\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 21:43:06 +1100 (AEDT)",
            "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4fhy0V2cGTz4w93\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 21:43:06 +1100 (AEDT)",
            "by gandalf.ozlabs.org (Postfix)\n\tid 4fhy0V2JQvz4wB7; Fri, 27 Mar 2026 21:43:06 +1100 (AEDT)",
            "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 4fhy0Q5qnqz4w93\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 27 Mar 2026 21:43:02 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 3F53A30F9E26\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 27 Mar 2026 10:35:32 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 406653DD50E;\n\tFri, 27 Mar 2026 10:34:41 +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 4AECD38551F;\n\tFri, 27 Mar 2026 10:34:34 +0000 (UTC)",
            "from mail.maildlp.com (unknown [172.19.163.170])\n\tby dggsgout11.his.huawei.com (SkyGuard) with ESMTPS id 4fhxpL33gczYQv2t;\n\tFri, 27 Mar 2026 18:34:18 +0800 (CST)",
            "from mail02.huawei.com (unknown [10.116.40.112])\n\tby mail.maildlp.com (Postfix) with ESMTP id 0926A40572;\n\tFri, 27 Mar 2026 18:34:32 +0800 (CST)",
            "from huaweicloud.com (unknown [10.50.85.155])\n\tby APP1 (Coremail) with SMTP id cCh0CgC3utouXcZp_T2cCQ--.28730S6;\n\tFri, 27 Mar 2026 18:34:31 +0800 (CST)"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1774608186; cv=pass;\n\tb=vMck32myKrLvqogVzdiOl3M4hG6V6GFlbTrRinOoWmA9ZW45deAUevQ7xhOPaxRG3ZWFmHF7IiyJ4PJ2luvy4OCbvG2YrhaFDDy1h5cqn616bcLG8p7d93nVp1HLQhSZX7O9arE5ybimpVZ0VTqgOJvWolxcHX7BNcmU/Jsj438Pz+sGsoxRyA8HwrCqwT9V9Q9nRSMdafvYmzFmG7yyx94vm9iahJVKahYSef0azMrB8YaboiA8iTVLrddotBhVnJEQSZ1HzaVHgN9glRYk4lfP94dvxtR2b/Vid9wenykWjnP+F2YRa95PooflfRaynXkMUJq0GcZYsEe3r/xGZQ==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774607680; cv=none;\n b=EERfB+h2H1bSd4TE8JM8D4U1drDu5Uf//p6ds8h1AxJDOn2iiYLy+ZGbtFQjR5G8qydm7kQvWCkp1QYUx8qly65PL6u7/aOFbtFmeUXW7HgMisZ3eCjF1elrXiWNb/LWbqzVZVtegHssY5FvzYGYtCwGkC52+CLml7pmn3M6HCY="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1774608186; c=relaxed/relaxed;\n\tbh=39laf8dd/ev8aG7RMwAJRN/jteSz6Z2HH4RsR3GiQRo=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=gVdpw3qQswYyW2b+66YZRK/vovet4ukH5qHooUthbkWZZTjTzSssJ6dWOlmkeU43IY5XjIHLbCt0spio0LlaTd31X0lGSuwAIbNE0upGfvaqhWDJmF5GLdZmiwsV8bGw7JAWVbLbojrUt3UB1VCoXSVRuBUZ4soZRAd/jZPm9dJvE/am3LqyEPjbODZVHQ3xtnwGugYaxcSvDuCmRuG/lRJ5bkpddnOXSvvU4odcSszH8dVb9LjeV0rfYWZaTC9j1GvIEr5fBL7qYtDBuyfbrNkIbftY48fxNJ77cSDVmkcvWcCABvjERn0W3QOtev2JE6y3djKBwyZuACLKWYYNpQ==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774607680; c=relaxed/simple;\n\tbh=I4XHiujXs7qhKUx4JhAgRX0qgoLkJvpiinPfQkkp0yI=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=aocAe7/RTUaNQRtzaNSZRI4GDvME8pswPRPAYh/ZaLlJxcifS0WtyfDoGQ4EndGconRWD+PtHC7iZ2V3dTen8ZaqJfpzvVfBP3Q1+rhEbMUFfpBhwVY8gNYLPqsBFzUDvoIpe7DPxjzQLWnmiJarKifQCbQF5DsjJWlfoo04hvM="
        ],
        "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-15487-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=pass 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",
        "Cc": "linux-fsdevel@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\ttytso@mit.edu,\n\tadilger.kernel@dilger.ca,\n\tjack@suse.cz,\n\tojaswin@linux.ibm.com,\n\tritesh.list@gmail.com,\n\tlibaokun@linux.alibaba.com,\n\tyi.zhang@huawei.com,\n\tyi.zhang@huaweicloud.com,\n\tyizhang089@gmail.com,\n\tyangerkun@huawei.com,\n\tyukuai@fnnas.com",
        "Subject": "[PATCH v4 02/13] ext4: rename and extend ext4_block_truncate_page()",
        "Date": "Fri, 27 Mar 2026 18:29:28 +0800",
        "Message-ID": "<20260327102939.1095257-3-yi.zhang@huaweicloud.com>",
        "X-Mailer": "git-send-email 2.52.0",
        "In-Reply-To": "<20260327102939.1095257-1-yi.zhang@huaweicloud.com>",
        "References": "<20260327102939.1095257-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": "cCh0CgC3utouXcZp_T2cCQ--.28730S6",
        "X-Coremail-Antispam": "1UD129KBjvJXoW3XF18Ar1kWw1fCF48tw15XFb_yoW7uw15p3\n\t43Aw15Cr1j9ryq9F4IgFsrZr4a93W8GF4UWrWfKryrZasrXF1xKF1DtF1FyFWjqrWxXa1j\n\tqFs8KrWjgw17J3DanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2\n\t9KBjDU0xBIdaVrnRJUUUm014x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0\n\trVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_Jryl82xGYIkIc2\n\tx26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0\n\tY4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw\n\tA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS\n\t0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2\n\tIY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0\n\tY48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628vn2kIc2\n\txKxwCY1x0262kKe7AKxVWUtVW8ZwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWU\n\tJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67\n\tkF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY\n\t6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0x\n\tvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVj\n\tvjDU0xZFpf9x0JUADGOUUUUU=",
        "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\nRename ext4_block_truncate_page() to ext4_block_zero_eof() and extend\nits signature to accept an explicit 'end' offset instead of calculating\nthe block boundary. This helper function now can replace all cases\nrequiring zeroing of the partial EOF block, including the append\nbuffered write paths in ext4_*_write_end().\n\nSigned-off-by: Zhang Yi <yi.zhang@huawei.com>\nReviewed-by: Jan Kara <jack@suse.cz>\n---\n fs/ext4/ext4.h    |  2 ++\n fs/ext4/extents.c |  4 ++--\n fs/ext4/inode.c   | 43 ++++++++++++++++++++++++-------------------\n 3 files changed, 28 insertions(+), 21 deletions(-)",
    "diff": "diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h\nindex 293f698b7042..c62459ef9796 100644\n--- a/fs/ext4/ext4.h\n+++ b/fs/ext4/ext4.h\n@@ -3099,6 +3099,8 @@ extern int ext4_chunk_trans_blocks(struct inode *, int nrblocks);\n extern int ext4_chunk_trans_extent(struct inode *inode, int nrblocks);\n extern int ext4_meta_trans_blocks(struct inode *inode, int lblocks,\n \t\t\t\t  int pextents);\n+extern int ext4_block_zero_eof(handle_t *handle, struct inode *inode,\n+\t\t\t       loff_t from, loff_t end);\n extern int ext4_zero_partial_blocks(handle_t *handle, struct inode *inode,\n \t\t\t     loff_t lstart, loff_t lend);\n extern vm_fault_t ext4_page_mkwrite(struct vm_fault *vmf);\ndiff --git a/fs/ext4/extents.c b/fs/ext4/extents.c\nindex ae3804f36535..a265070c1b79 100644\n--- a/fs/ext4/extents.c\n+++ b/fs/ext4/extents.c\n@@ -4625,8 +4625,8 @@ static int ext4_alloc_file_blocks(struct file *file, ext4_lblk_t offset,\n \t\t\t\t\t\t      inode_get_ctime(inode));\n \t\t\tif (epos > old_size) {\n \t\t\t\tpagecache_isize_extended(inode, old_size, epos);\n-\t\t\t\text4_zero_partial_blocks(handle, inode,\n-\t\t\t\t\t\t     old_size, epos - old_size);\n+\t\t\t\text4_block_zero_eof(handle, inode, old_size,\n+\t\t\t\t\t\t    epos);\n \t\t\t}\n \t\t}\n \t\tret2 = ext4_mark_inode_dirty(handle, inode);\ndiff --git a/fs/ext4/inode.c b/fs/ext4/inode.c\nindex 1c9474d5d11d..5b601b8a4453 100644\n--- a/fs/ext4/inode.c\n+++ b/fs/ext4/inode.c\n@@ -1458,7 +1458,7 @@ static int ext4_write_end(const struct kiocb *iocb,\n \n \tif (old_size < pos && !verity) {\n \t\tpagecache_isize_extended(inode, old_size, pos);\n-\t\text4_zero_partial_blocks(handle, inode, old_size, pos - old_size);\n+\t\text4_block_zero_eof(handle, inode, old_size, pos);\n \t}\n \t/*\n \t * Don't mark the inode dirty under folio lock. First, it unnecessarily\n@@ -1576,7 +1576,7 @@ static int ext4_journalled_write_end(const struct kiocb *iocb,\n \n \tif (old_size < pos && !verity) {\n \t\tpagecache_isize_extended(inode, old_size, pos);\n-\t\text4_zero_partial_blocks(handle, inode, old_size, pos - old_size);\n+\t\text4_block_zero_eof(handle, inode, old_size, pos);\n \t}\n \n \tif (size_changed) {\n@@ -3252,7 +3252,7 @@ static int ext4_da_do_write_end(struct address_space *mapping,\n \tif (IS_ERR(handle))\n \t\treturn PTR_ERR(handle);\n \tif (zero_len)\n-\t\text4_zero_partial_blocks(handle, inode, old_size, zero_len);\n+\t\text4_block_zero_eof(handle, inode, old_size, pos);\n \text4_mark_inode_dirty(handle, inode);\n \text4_journal_stop(handle);\n \n@@ -4132,26 +4132,31 @@ static int ext4_block_zero_page_range(handle_t *handle,\n }\n \n /*\n- * ext4_block_truncate_page() zeroes out a mapping from file offset `from'\n- * up to the end of the block which corresponds to `from'.\n- * This required during truncate. We need to physically zero the tail end\n- * of that block so it doesn't yield old data if the file is later grown.\n+ * Zero out a mapping from file offset 'from' up to the end of the block\n+ * which corresponds to 'from' or to the given 'end' inside this block.\n+ * This required during truncate up and performing append writes. We need\n+ * to physically zero the tail end of that block so it doesn't yield old\n+ * data if the file is grown.\n  */\n-static int ext4_block_truncate_page(handle_t *handle,\n-\t\tstruct address_space *mapping, loff_t from)\n+int ext4_block_zero_eof(handle_t *handle, struct inode *inode,\n+\t\t\tloff_t from, loff_t end)\n {\n-\tunsigned length;\n-\tunsigned blocksize;\n-\tstruct inode *inode = mapping->host;\n+\tunsigned int blocksize = i_blocksize(inode);\n+\tunsigned int offset;\n+\tloff_t length = end - from;\n \n+\toffset = from & (blocksize - 1);\n+\tif (!offset || from >= end)\n+\t\treturn 0;\n \t/* If we are processing an encrypted inode during orphan list handling */\n \tif (IS_ENCRYPTED(inode) && !fscrypt_has_encryption_key(inode))\n \t\treturn 0;\n \n-\tblocksize = i_blocksize(inode);\n-\tlength = blocksize - (from & (blocksize - 1));\n+\tif (length > blocksize - offset)\n+\t\tlength = blocksize - offset;\n \n-\treturn ext4_block_zero_page_range(handle, mapping, from, length, NULL);\n+\treturn ext4_block_zero_page_range(handle, inode->i_mapping, from,\n+\t\t\t\t\t  length, NULL);\n }\n \n int ext4_zero_partial_blocks(handle_t *handle, struct inode *inode,\n@@ -4500,7 +4505,6 @@ int ext4_truncate(struct inode *inode)\n \tunsigned int credits;\n \tint err = 0, err2;\n \thandle_t *handle;\n-\tstruct address_space *mapping = inode->i_mapping;\n \n \t/*\n \t * There is a possibility that we're either freeing the inode\n@@ -4543,8 +4547,9 @@ int ext4_truncate(struct inode *inode)\n \t\tgoto out_trace;\n \t}\n \n+\t/* Zero to the end of the block containing i_size */\n \tif (inode->i_size & (inode->i_sb->s_blocksize - 1))\n-\t\text4_block_truncate_page(handle, mapping, inode->i_size);\n+\t\text4_block_zero_eof(handle, inode, inode->i_size, LLONG_MAX);\n \n \t/*\n \t * We add the inode to the orphan list, so that if this\n@@ -5921,8 +5926,8 @@ int ext4_setattr(struct mnt_idmap *idmap, struct dentry *dentry,\n \t\t\t\tinode_set_mtime_to_ts(inode,\n \t\t\t\t\t\t      inode_set_ctime_current(inode));\n \t\t\t\tif (oldsize & (inode->i_sb->s_blocksize - 1))\n-\t\t\t\t\text4_block_truncate_page(handle,\n-\t\t\t\t\t\t\tinode->i_mapping, oldsize);\n+\t\t\t\t\text4_block_zero_eof(handle, inode,\n+\t\t\t\t\t\t\t    oldsize, LLONG_MAX);\n \t\t\t}\n \n \t\t\tif (shrink)\n",
    "prefixes": [
        "v4",
        "02/13"
    ]
}