From: Zhang Yi <yi.zhang@huaweicloud.com>
To: linux-ext4@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz,
ojaswin@linux.ibm.com, ritesh.list@gmail.com,
libaokun@linux.alibaba.com, yi.zhang@huawei.com,
yizhang089@gmail.com, yangerkun@huawei.com, yukuai@fnnas.com
Subject: Re: [PATCH v2 00/10] ext4: refactor partial block zero-out for iomap conversion
Date: Thu, 26 Mar 2026 16:53:03 +0800 [thread overview]
Message-ID: <4cb874b7-f5e3-4612-a2cd-c5e707c72985@huaweicloud.com> (raw)
In-Reply-To: <20260325072850.3997161-1-yi.zhang@huaweicloud.com>
On 3/25/2026 3:28 PM, Zhang Yi wrote:
> From: Zhang Yi <yi.zhang@huawei.com>
Sashiko found some real issues in patch 09 and 10, I will send v3 to fix them.
https://sashiko.dev/#/patchset/20260325072850.3997161-1-yi.zhang%40huaweicloud.com
Best Regards,
Yi.
>
> Changes since v1:
> - In patch 04, rename ext4_block_get_zero_range() to
> ext4_load_tail_bh() and drop the unused 'length' parameter as Jan
> suggested.
> - In patch 06, modify the commit message, add another reason to drop
> data=ordered mode when zeroing partial blocks in ext4_punch_hole()
> and ext4_punch_hole() as Jan pointed out.
> - In patch 10, modify the commit message, explain the race condition
> between the buffered write and mmap write that pointed out by Jan.
> - Collect reviewed tags from Jan.
>
> v1: https://lore.kernel.org/linux-ext4/20260310014101.4140698-1-yi.zhang@huaweicloud.com/
>
> Original cover letter:
>
> This patch series extracted from my iomap conversion v2 series[1]. It
> refactors the ext4 zero partial block code path in preparation for
> converting buffered I/O to the iomap infrastructure. The main changes
> are:
>
> [1] https://lore.kernel.org/linux-ext4/20260203062523.3869120-1-yi.zhang@huawei.com/
>
> 1. Introduce ext4_block_zero_eof(): Extend and rename
> ext4_block_truncate_page() to handle post-EOF partial block zeroing
> for both append writes and truncate operations.
> 2. Separate ordered data handling: Move data=ordered mode handling from
> __ext4_block_zero_page_range to ext4_block_zero_eof(). Only truncate
> and post-EOF append write/fallocate paths need ordered data mode,
> hole punching and zero range paths don't need ordered data handling.
> 3. Split journal mode handling: Extract
> ext4_block_journalled_zero_range() from
> __ext4_block_zero_page_range() for data=journal mode, leaving
> ext4_block_do_zero_range() for data=ordered/writeback modes.
> 4. Refactor ext4_alloc_file_blocks(): Change parameters to loff_t byte
> granularity to simplify callers and prepares removing the zero call
> from the allocation loop for unaligned append writes.
> 5. Remove handle parameters: Stop passing handle_t * to zero functions.
> Make ext4_block_journalled_zero_range() start its own handle, and
> move zero operations outside active handles. This is required because
> iomap uses "folio lock -> transaction start" lock ordering, opposite
> to the current lock ordering.
> 6. Centralize zeroing in ext4_write_checks(): Move all post-EOF partial
> block zeroing to ext4_write_checks() so it applies to both regular
> buffered writes and the upcoming iomap path.
>
> Thanks
> Yi.
>
> Zhang Yi (10):
> ext4: add did_zero output parameter to ext4_block_zero_page_range()
> ext4: ext4_block_truncate_page() returns zeroed length on success
> ext4: rename and extend ext4_block_truncate_page()
> ext4: factor out journalled block zeroing range
> ext4: rename ext4_block_zero_page_range() to ext4_block_zero_range()
> ext4: move ordered data handling out of ext4_block_do_zero_range()
> ext4: remove handle parameters from zero partial block functions
> ext4: pass allocate range as loff_t to ext4_alloc_file_blocks()
> ext4: move zero partial block range functions out of active handle
> ext4: zero post-EOF partial block before appending write
>
> fs/ext4/ext4.h | 5 +-
> fs/ext4/extents.c | 83 +++++++--------
> fs/ext4/file.c | 14 +++
> fs/ext4/inode.c | 255 ++++++++++++++++++++++++++++------------------
> 4 files changed, 207 insertions(+), 150 deletions(-)
>
prev parent reply other threads:[~2026-03-26 9:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-25 7:28 [PATCH v2 00/10] ext4: refactor partial block zero-out for iomap conversion Zhang Yi
2026-03-25 7:28 ` [PATCH v2 01/10] ext4: add did_zero output parameter to ext4_block_zero_page_range() Zhang Yi
2026-03-25 7:28 ` [PATCH v2 02/10] ext4: ext4_block_truncate_page() returns zeroed length on success Zhang Yi
2026-03-25 7:28 ` [PATCH v2 03/10] ext4: rename and extend ext4_block_truncate_page() Zhang Yi
2026-03-25 7:28 ` [PATCH v2 04/10] ext4: factor out journalled block zeroing range Zhang Yi
2026-03-25 7:28 ` [PATCH v2 05/10] ext4: rename ext4_block_zero_page_range() to ext4_block_zero_range() Zhang Yi
2026-03-25 7:28 ` [PATCH v2 06/10] ext4: move ordered data handling out of ext4_block_do_zero_range() Zhang Yi
2026-03-25 7:28 ` [PATCH v2 07/10] ext4: remove handle parameters from zero partial block functions Zhang Yi
2026-03-25 7:28 ` [PATCH v2 08/10] ext4: pass allocate range as loff_t to ext4_alloc_file_blocks() Zhang Yi
2026-03-25 7:28 ` [PATCH v2 09/10] ext4: move zero partial block range functions out of active handle Zhang Yi
2026-03-25 7:28 ` [PATCH v2 10/10] ext4: zero post-EOF partial block before appending write Zhang Yi
2026-03-26 8:53 ` Zhang Yi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4cb874b7-f5e3-4612-a2cd-c5e707c72985@huaweicloud.com \
--to=yi.zhang@huaweicloud.com \
--cc=adilger.kernel@dilger.ca \
--cc=jack@suse.cz \
--cc=libaokun@linux.alibaba.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
--cc=tytso@mit.edu \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yizhang089@gmail.com \
--cc=yukuai@fnnas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox