Re: [PATCH v2] ext4: fix the logical block counter overflow in indirect migration
From: Theodore Ts'o
Date: Thu Nov 19 2026 - 09:51:02 EST
On Mon, 14 Sep 2026 16:25:16 +0800, Yichong Chen wrote:
> update_tind_extent_range() advances lb->curr_block, an ext4_lblk_t, by
> max_entries * max_entries for every empty triple-indirect slot. One
> triple-indirect block spans max_entries^3 logical blocks, which exceeds
> 2^32 as soon as the block size is 8K or larger (16384^3 = 2^42 with 64K
> blocks), so the counter wraps while that block is walked.
>
> A wrapped counter makes the migration store a block number that is 2^32
> blocks away from the one the pointer block describes. Two ranges can then
> end up with the same ee_block, which trips
> BUG_ON(newext->ee_block == nearex->ee_block) in ext4_ext_insert_extent(),
> and without that collision the data is still moved to the wrong logical
> block while the migration reports success.
>
> [...]
Applied, thanks!
[1/1] ext4: fix the logical block counter overflow in indirect migration
commit: 42be4bd54735ec52b2c8aef62cc068ac5f918f52
Best regards,
--
Theodore Ts'o <tytso@xxxxxxx>