Re: [PATCH] ext4: keep ordered data and i_disksize consistent on size changes

From: Yichong Chen

Date: Mon Nov 23 2026 - 23:04:48 EST


Hi Ted, Honza,

Apologies first: when I set up the test configuration here I missed the
ext4 expunge rule for these three tests, and reported them as new
failures. That was my mistake - the rule has been in xfstests-bld since
2017.

On Fri, Nov 20, 2026 at 01:02:24PM -0500, Jan Kara wrote:
> Yes, and as the LLM probably told you these checks are failing on ext4 for
> ages and no real user complained. Ted may have a different opinion but I
> don't think we care about fixing them, in particular given the costs in
> complexity of i_size updates and also performance of appending writes /
> truncate.

Honza - on the cost concern. My benchmarks confirmed your point. What
the series touches is only ftruncate() with delalloc data, and the
overhead is mostly negligible. For example, shrink after fsync only adds
+2.8us (172.72us -> 175.53us). The worst case is an immediate shrink
after a dirty write (+30us), which confirms the complexity/performance
trade-off you raised.

On Sat, Nov 21, 2026 00:18 AM -0500, Theodore Ts'o wrote:
> Yes. In addition, there was never any data integrity guarantees of
> data=ordered. The main reason why this exists is to avoid any stale
> data belonging a deleted file...
> The only reason why we have data=ordered is because we use the order
> of operations from ext2... Once we change things so that we write the
> data block to the newly allocated block, and *then* we make the
> metadata change, we can unify data=ordered and data=writeback...

Ted - thanks for the detailed explanation on the ordered-mode history
and the long-term unification plan.

For context on why I was digging into this: I have been following Zhang
Yi's iomap buffered I/O series targeting ext4 dev. While running
xfstests to validate those interactions, I triggered the NULL file
scenarios. I initially suspected an inconsistency between the 2015 and
2021 commits, but I realize now they are dependent, and this is expected
data=writeback semantics (zeros instead of data), not a metadata
consistency break.

Given your explanation, the acceptable writeback semantics, and the fact
that this code is being rewritten by the iomap series
(EXT4_STATE_DISKSIZE_GROW_PENDING), I will drop my patch series without
pushback.

Thanks for the guidance, and I look forward to the iomap unification.

Best,
Morduan