Re: [REGRESSION] ext4: silent data loss when a split at I/O completion gets ENOSPC

From: Jose Fernandez (Anthropic)

Date: Fri Nov 27 2026 - 12:45:46 EST


On Tue, Nov 24, 2026 Zhang Yi wrote:
> My idea is to make this a real reservation of currently allocatable
> clusters rather than just a counter check. We can subtract
> sbi->s_mb_free_pending from free_clusters in ext4_has_free_clusters().

This makes sense to me.

> However, the probability of returning ENOSPC for pure append writes
> increases by about 10%.

Our agents tried a close variant of it on mainline, with an exception
for EXT4_MB_USE_RESERVED. The reproducer lost 0 of 72 files instead of
32 of 72. But write() got ENOSPC on 54 of 540 delalloc files, against
none without it, with the filesystem at most about half full. The
writers ran as root. Is your 10% before or after
ext4_should_retry_alloc() gives up? Ours is after.

We can test the patch once it is posted.

- Jose