Re: [PATCH v2] ext4: return an error when a journal block is not mapped

From: Karl Mehltretter

Date: Sat Nov 14 2026 - 04:25:57 EST


On Fri, Oct 16, 2026 at 12:37:26PM +0100, Karl Mehltretter wrote:
> If the internal journal inode contains a hole, ext4_map_blocks() returns
> 0. ext4_journal_bmap() logs "journal bmap failed" and aborts the
> journal, but also returns 0 and leaves *block unchanged.
>
> jbd2_journal_bmap() takes that as success and uses the unchanged logical
> journal block number as a physical filesystem block number. Journal I/O
> can then overwrite filesystem blocks outside the journal despite the
> abort.
>
> Return -EFSCORRUPTED for a hole, matching the error passed to
> jbd2_journal_abort(). Keep propagating negative mapping errors.
>
> Fixes: 62913ae96de7 ("ext4, jbd2: add an optimized bmap for the journal inode")

A friendly ping on this ext4_journal_bmap() fix, which carries
Reviewed-by tags from Jan Kara and Zhang Yi. Is anything else needed
from my side?

Karl