Re: [PATCH -next v2 03/22] ext4: only order data when partially block truncating down

From: Zhang Yi

Date: Tue Feb 10 2026 - 11:13:01 EST


On 2/10/2026 10:07 PM, Jan Kara wrote:
On Tue 10-02-26 20:02:51, Zhang Yi wrote:
On 2/9/2026 4:28 PM, Zhang Yi wrote:
On 2/6/2026 11:35 PM, Jan Kara wrote:
On Fri 06-02-26 19:09:53, Zhang Yi wrote:
On 2/5/2026 11:05 PM, Jan Kara wrote:
So how about the following:

Let me see, please correct me if my understanding is wrong, ana there are
also some points I don't get.

We expand our io_end processing with the
ability to journal i_disksize updates after page writeback completes. Then

While I was extending the end_io path of buffered_head to support updating
i_disksize, I found another problem that requires discussion.

Supporting updates to i_disksize in end_io requires starting a handle, which
conflicts with the data=ordered mode because folios written back through the
journal process cannot initiate any handles; otherwise, this may lead to a
deadlock. This limitation does not affect the iomap path, as it does not use
the data=ordered mode at all. However, in the buffered_head path, online
defragmentation (if this change works, it should be the last user) still uses
the data=ordered mode.

Right and my intention was to use reserved handle for the i_disksize update
similarly as we currently use reserved handle for unwritten extent
conversion after page writeback is done.

Honza

IIUC, reserved handle only works for ext4_jbd2_inode_add_wait(). It doesn't work for ext4_jbd2_inode_add_write() because writebacks triggered by the journaling process cannot initiate any handles, including reserved handles. So, I guess you're suggesting that within mext_move_extent(), we should proactively submit the blocks after swapping, and then call ext4_jbd2_inode_add_wait() to replace the existing ext4_jbd2_inode_add_write(). Is that correct?

Thanks,
Yi.