Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2216389/?format=api
{ "id": 2216389, "url": "http://patchwork.ozlabs.org/api/patches/2216389/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/20260326111054.907252-7-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": "<20260326111054.907252-7-yi.zhang@huaweicloud.com>", "list_archive_url": null, "date": "2026-03-26T11:10:49", "name": "[v3,06/11] ext4: remove handle parameters from zero partial block functions", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "45dc52781bda19507c1b0e4644291323de3f26c1", "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/20260326111054.907252-7-yi.zhang@huaweicloud.com/mbox/", "series": [ { "id": 497571, "url": "http://patchwork.ozlabs.org/api/series/497571/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/list/?series=497571", "date": "2026-03-26T11:10:46", "name": "ext4: refactor partial block zero-out for iomap conversion", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/497571/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2216389/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2216389/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <SRS0=2HJr=B2=vger.kernel.org=linux-ext4+bounces-15440-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=2hjr=b2=vger.kernel.org=linux-ext4+bounces-15440-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)", "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=172.234.253.10 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.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15440-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=45.249.212.56", "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 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 4fhLxb2LN4z1y1x\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 22:23:31 +1100 (AEDT)", "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4fhLxb262mz4wHX\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 22:23:31 +1100 (AEDT)", "by gandalf.ozlabs.org (Postfix)\n\tid 4fhLxb21fmz4wSL; Thu, 26 Mar 2026 22:23:31 +1100 (AEDT)", "from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\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 4fhLxW70gdz4wHX\n\tfor <patchwork-incoming@ozlabs.org>; Thu, 26 Mar 2026 22:23:27 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id EDF1B305262E\n\tfor <patchwork-incoming@ozlabs.org>; Thu, 26 Mar 2026 11:16:02 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 7361D38F22D;\n\tThu, 26 Mar 2026 11:15:55 +0000 (UTC)", "from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com\n [45.249.212.56])\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 CB1F038239B;\n\tThu, 26 Mar 2026 11:15:51 +0000 (UTC)", "from mail.maildlp.com (unknown [172.19.163.177])\n\tby dggsgout12.his.huawei.com (SkyGuard) with ESMTPS id 4fhLlx6KMWzKHMlj;\n\tThu, 26 Mar 2026 19:15:09 +0800 (CST)", "from mail02.huawei.com (unknown [10.116.40.112])\n\tby mail.maildlp.com (Postfix) with ESMTP id 0D7704058D;\n\tThu, 26 Mar 2026 19:15:50 +0800 (CST)", "from huaweicloud.com (unknown [10.50.85.155])\n\tby APP1 (Coremail) with SMTP id cCh0CgD3+NhWFcVprDInCQ--.2580S10;\n\tThu, 26 Mar 2026 19:15:49 +0800 (CST)" ], "ARC-Seal": [ "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1774524211; cv=pass;\n\tb=keEILxx41JFvpoiH1wniV2GxIoeoCIH/K7LE6a8ftQOe9rxj70NraV8otvMl+r/hwsX9gJJ4TTaxGBV07AESynZo1TS3ocUPzBPiUh4I6QY8y0Yqpg+z4AD6WbxdvY0cXI9vEQq18FFaLANAvsRsXJ3IdohIM/J9a/i833NjcxpNGYpv3ebiY8nZNeSt/Ox+NzRisFhxGx0TVeOl8oAhAWRmq4cgJDuxpZFATFzAwP/eq4GoMphfFYFsypfKdWf55noabE+2dk4+LZl2AeUfnZFWFa0/qVoerpwnNTaBsD0twcnhdzyH3ti7LSGb+v4zsYUWlHNyewVKE1d9522xFQ==", "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774523755; cv=none;\n b=cBOEuko+i5i/XBr26KfF0eA6tzGVsisCLt1No0FFCTUh18jQBICHS3dKwRazWmzi8c/WFNmK3etKUt/7lQumRgvRPclV5Wf7/SfGKVVdXL1QAHUzxMju7tFdSTPfxUoCCsveDwy2zrEMYcKMKt4bipFALUtvucuSwS/QNaRHAOo=" ], "ARC-Message-Signature": [ "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1774524211; c=relaxed/relaxed;\n\tbh=gWajimfIBuXMk0jG0OynnPLkHKvJwW3y9Qez+XxCBp0=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=JDlRn7gx3yA37N/yEPxUnD2zb3rUfayGuTcGOOnFbIOxvdcRKhb8gmgdORIuDbbLkcG+7KNoREiKzvyE7Z5A136W1yHe1lIv+5jxrb+svaeOlC7alUMDZiht6/tN+7gLgjqYhPhI4yRDlCmCnDG+9SiMSyFDu/hqwE5sGJEoPhSITRk/bThJK0krho9w3kq0250a6wb9FD++zm5r2+4rO4fpqa7j+8y43vIxKpt5+ntUEwKSNQ4ZstloMisy9nyM9nEmEFKAT41AfBR++b/NHYin4LrR2QENYs+UeWMeu2b3kMwiCYbEJD0LdzPdZyYUEiOjNm+VzKCaJX0MtF5zjA==", "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774523755; c=relaxed/simple;\n\tbh=9g2x6Qbjyhqkv1VxjCVvNgCfVDAo7IdAPNC9y4TjOd8=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=IY7axBaHrxXTqNMSZ+8cGT13xVsKBNJQH2bc2GoWUNC/shxgKqjy3cT1HBtXRsH3HCaz+Pa5hH4f1qjPFmWROeucmq7Zw3FgVEffImvvNXhC7izDfeOAD4a16GF1Q9ZR7ATkV2eZnCdc4iiEiCZEvZ2bMbbBnA41FA2SJXsmyic=" ], "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.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-15440-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.56" ], "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 v3 06/11] ext4: remove handle parameters from zero partial\n block functions", "Date": "Thu, 26 Mar 2026 19:10:49 +0800", "Message-ID": "<20260326111054.907252-7-yi.zhang@huaweicloud.com>", "X-Mailer": "git-send-email 2.52.0", "In-Reply-To": "<20260326111054.907252-1-yi.zhang@huaweicloud.com>", "References": "<20260326111054.907252-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": "cCh0CgD3+NhWFcVprDInCQ--.2580S10", "X-Coremail-Antispam": "1UD129KBjvJXoW3Xw1rKw47Kr4DGw4rWw17KFg_yoWfur4Dp3\n\t4UJw1UCr43uryv9F4IgF47Zr1a93WxGF48WryfGryFvaykX3Z7KF1DKF1FyF4jqr47Wa10\n\tvF4Yy34jg3WUJ3DanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2\n\t9KBjDU0xBIdaVrnRJUUUmS14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0\n\trVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYI\n\tkIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2\n\tz4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F\n\t4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq\n\t3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7\n\tIYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4U\n\tM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628vn2\n\tkIc2xKxwCY1x0262kKe7AKxVWUtVW8ZwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkE\n\tbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67\n\tAF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUCVW8JwCI\n\t42IY6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF\n\t4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8Jr0_Cr1UYxBI\n\tdaVFxhVjvjDU0xZFpf9x0JUQFxUUUUUU=", "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\nOnly journal data mode requires an active journal handle when zeroing\npartial blocks. Stop passing handle_t *handle to\next4_zero_partial_blocks() and related functions, and make\next4_block_journalled_zero_range() start a handle independently.\n\nThis change has no practical impact now because all callers invoke these\nfunctions within the context of an active handle. It prepares for moving\next4_block_zero_eof() out of an active handle in the next patch, which\nis a prerequisite for converting block zero range operations to iomap\ninfrastructure.\n\nSigned-off-by: Zhang Yi <yi.zhang@huawei.com>\nReviewed-by: Jan Kara <jack@suse.cz>\n---\n fs/ext4/ext4.h | 7 ++---\n fs/ext4/extents.c | 5 ++--\n fs/ext4/inode.c | 71 ++++++++++++++++++++++++++++-------------------\n 3 files changed, 48 insertions(+), 35 deletions(-)", "diff": "diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h\nindex c62459ef9796..859ae05339ad 100644\n--- a/fs/ext4/ext4.h\n+++ b/fs/ext4/ext4.h\n@@ -3099,10 +3099,9 @@ 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 int ext4_block_zero_eof(struct inode *inode, loff_t from, loff_t end);\n+extern int ext4_zero_partial_blocks(struct inode *inode, loff_t lstart,\n+\t\t\t\t loff_t length);\n extern vm_fault_t ext4_page_mkwrite(struct vm_fault *vmf);\n extern qsize_t *ext4_get_reserved_space(struct inode *inode);\n extern int ext4_get_projid(struct inode *inode, kprojid_t *projid);\ndiff --git a/fs/ext4/extents.c b/fs/ext4/extents.c\nindex a265070c1b79..753a0f3418a4 100644\n--- a/fs/ext4/extents.c\n+++ b/fs/ext4/extents.c\n@@ -4625,8 +4625,7 @@ 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_block_zero_eof(handle, inode, old_size,\n-\t\t\t\t\t\t epos);\n+\t\t\t\text4_block_zero_eof(inode, old_size, epos);\n \t\t\t}\n \t\t}\n \t\tret2 = ext4_mark_inode_dirty(handle, inode);\n@@ -4744,7 +4743,7 @@ static long ext4_zero_range(struct file *file, loff_t offset,\n \t}\n \n \t/* Zero out partial block at the edges of the range */\n-\tret = ext4_zero_partial_blocks(handle, inode, offset, len);\n+\tret = ext4_zero_partial_blocks(inode, offset, len);\n \tif (ret)\n \t\tgoto out_handle;\n \ndiff --git a/fs/ext4/inode.c b/fs/ext4/inode.c\nindex a480676193f4..94c8e8c3984f 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_block_zero_eof(handle, inode, old_size, pos);\n+\t\text4_block_zero_eof(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_block_zero_eof(handle, inode, old_size, pos);\n+\t\text4_block_zero_eof(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_block_zero_eof(handle, inode, old_size, pos);\n+\t\text4_block_zero_eof(inode, old_size, pos);\n \text4_mark_inode_dirty(handle, inode);\n \text4_journal_stop(handle);\n \n@@ -4101,16 +4101,23 @@ static int ext4_block_do_zero_range(struct inode *inode, loff_t from,\n \treturn 0;\n }\n \n-static int ext4_block_journalled_zero_range(handle_t *handle,\n-\t\tstruct inode *inode, loff_t from, loff_t length, bool *did_zero)\n+static int ext4_block_journalled_zero_range(struct inode *inode, loff_t from,\n+\t\t\t\t\t loff_t length, bool *did_zero)\n {\n \tstruct buffer_head *bh;\n \tstruct folio *folio;\n+\thandle_t *handle;\n \tint err;\n \n+\thandle = ext4_journal_start(inode, EXT4_HT_MISC, 1);\n+\tif (IS_ERR(handle))\n+\t\treturn PTR_ERR(handle);\n+\n \tbh = ext4_load_tail_bh(inode, from);\n-\tif (IS_ERR_OR_NULL(bh))\n-\t\treturn PTR_ERR_OR_ZERO(bh);\n+\tif (IS_ERR_OR_NULL(bh)) {\n+\t\terr = PTR_ERR_OR_ZERO(bh);\n+\t\tgoto out_handle;\n+\t}\n \tfolio = bh->b_folio;\n \n \tBUFFER_TRACE(bh, \"get write access\");\n@@ -4131,6 +4138,8 @@ static int ext4_block_journalled_zero_range(handle_t *handle,\n out:\n \tfolio_unlock(folio);\n \tfolio_put(folio);\n+out_handle:\n+\text4_journal_stop(handle);\n \treturn err;\n }\n \n@@ -4141,7 +4150,7 @@ static int ext4_block_journalled_zero_range(handle_t *handle,\n * the end of the block it will be shortened to end of the block\n * that corresponds to 'from'\n */\n-static int ext4_block_zero_range(handle_t *handle, struct inode *inode,\n+static int ext4_block_zero_range(struct inode *inode,\n \t\t\t\t loff_t from, loff_t length, bool *did_zero,\n \t\t\t\t bool *zero_written)\n {\n@@ -4159,8 +4168,8 @@ static int ext4_block_zero_range(handle_t *handle, struct inode *inode,\n \t\treturn dax_zero_range(inode, from, length, did_zero,\n \t\t\t\t &ext4_iomap_ops);\n \t} else if (ext4_should_journal_data(inode)) {\n-\t\treturn ext4_block_journalled_zero_range(handle, inode, from,\n-\t\t\t\t\t\t\tlength, did_zero);\n+\t\treturn ext4_block_journalled_zero_range(inode, from, length,\n+\t\t\t\t\t\t\tdid_zero);\n \t}\n \treturn ext4_block_do_zero_range(inode, from, length, did_zero,\n \t\t\t\t\tzero_written);\n@@ -4173,8 +4182,7 @@ static int ext4_block_zero_range(handle_t *handle, struct inode *inode,\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-int ext4_block_zero_eof(handle_t *handle, struct inode *inode,\n-\t\t\tloff_t from, loff_t end)\n+int ext4_block_zero_eof(struct inode *inode, loff_t from, loff_t end)\n {\n \tunsigned int blocksize = i_blocksize(inode);\n \tunsigned int offset;\n@@ -4193,7 +4201,7 @@ int ext4_block_zero_eof(handle_t *handle, struct inode *inode,\n \tif (length > blocksize - offset)\n \t\tlength = blocksize - offset;\n \n-\terr = ext4_block_zero_range(handle, inode, from, length,\n+\terr = ext4_block_zero_range(inode, from, length,\n \t\t\t\t &did_zero, &zero_written);\n \tif (err)\n \t\treturn err;\n@@ -4204,14 +4212,23 @@ int ext4_block_zero_eof(handle_t *handle, struct inode *inode,\n \t * mmap write during folio writeback.\n \t */\n \tif (ext4_should_order_data(inode) &&\n-\t did_zero && zero_written && !IS_DAX(inode))\n-\t\terr = ext4_jbd2_inode_add_write(handle, inode, from, length);\n+\t did_zero && zero_written && !IS_DAX(inode)) {\n+\t\thandle_t *handle;\n \n-\treturn err;\n+\t\thandle = ext4_journal_start(inode, EXT4_HT_MISC, 1);\n+\t\tif (IS_ERR(handle))\n+\t\t\treturn PTR_ERR(handle);\n+\n+\t\terr = ext4_jbd2_inode_add_write(handle, inode, from, length);\n+\t\text4_journal_stop(handle);\n+\t\tif (err)\n+\t\t\treturn err;\n+\t}\n+\n+\treturn 0;\n }\n \n-int ext4_zero_partial_blocks(handle_t *handle, struct inode *inode,\n-\t\t\t loff_t lstart, loff_t length)\n+int ext4_zero_partial_blocks(struct inode *inode, loff_t lstart, loff_t length)\n {\n \tstruct super_block *sb = inode->i_sb;\n \tunsigned partial_start, partial_end;\n@@ -4228,21 +4245,19 @@ int ext4_zero_partial_blocks(handle_t *handle, struct inode *inode,\n \t/* Handle partial zero within the single block */\n \tif (start == end &&\n \t (partial_start || (partial_end != sb->s_blocksize - 1))) {\n-\t\terr = ext4_block_zero_range(handle, inode, lstart,\n-\t\t\t\t\t length, NULL, NULL);\n+\t\terr = ext4_block_zero_range(inode, lstart, length, NULL, NULL);\n \t\treturn err;\n \t}\n \t/* Handle partial zero out on the start of the range */\n \tif (partial_start) {\n-\t\terr = ext4_block_zero_range(handle, inode, lstart,\n-\t\t\t\t\t sb->s_blocksize, NULL, NULL);\n+\t\terr = ext4_block_zero_range(inode, lstart, sb->s_blocksize,\n+\t\t\t\t\t NULL, NULL);\n \t\tif (err)\n \t\t\treturn err;\n \t}\n \t/* Handle partial zero out on the end of the range */\n \tif (partial_end != sb->s_blocksize - 1)\n-\t\terr = ext4_block_zero_range(handle, inode,\n-\t\t\t\t\t byte_end - partial_end,\n+\t\terr = ext4_block_zero_range(inode, byte_end - partial_end,\n \t\t\t\t\t partial_end + 1, NULL, NULL);\n \treturn err;\n }\n@@ -4438,7 +4453,7 @@ int ext4_punch_hole(struct file *file, loff_t offset, loff_t length)\n \t\treturn ret;\n \t}\n \n-\tret = ext4_zero_partial_blocks(handle, inode, offset, length);\n+\tret = ext4_zero_partial_blocks(inode, offset, length);\n \tif (ret)\n \t\tgoto out_handle;\n \n@@ -4588,7 +4603,7 @@ int ext4_truncate(struct inode *inode)\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_zero_eof(handle, inode, inode->i_size, LLONG_MAX);\n+\t\text4_block_zero_eof(inode, inode->i_size, LLONG_MAX);\n \n \t/*\n \t * We add the inode to the orphan list, so that if this\n@@ -5965,8 +5980,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_zero_eof(handle, inode,\n-\t\t\t\t\t\t\t oldsize, LLONG_MAX);\n+\t\t\t\t\text4_block_zero_eof(inode, oldsize,\n+\t\t\t\t\t\t\t LLONG_MAX);\n \t\t\t}\n \n \t\t\tif (shrink)\n", "prefixes": [ "v3", "06/11" ] }