Re: [PATCH v2] ext4: record writeback error when discarding pages on failed delalloc
From: Theodore Ts'o
Date: Thu Nov 19 2026 - 09:51:56 EST
On Fri, 16 Oct 2026 11:03:11 +0000, guolingxing wrote:
> When mpage_map_and_submit_extent() gives up on a failed block mapping,
> it sets give_up_on_write so that mpage_release_unused_pages() discards
> the remaining dirty folios. However, the error is not recorded in the
> mapping's writeback error state.
>
> If this happens during background writeback, a later fsync() may
> report success even though the dirty data was discarded and never
> written. Returning the error from ext4_writepages() is not sufficient
> to notify a later fsync(). In addition, ext4_do_writepages() may clear
> -ENOSPC when committing the journal and retrying, even after the
> affected dirty folios have been discarded.
>
> [...]
Applied, thanks!
[1/1] ext4: record writeback error when discarding pages on failed delalloc
commit: bc6d92e3cd19ec6b20e66c8cfee3e1ecb5f6e778
Best regards,
--
Theodore Ts'o <tytso@xxxxxxx>