Re: [PATCH] ext4: cap migration extent length at EXT_INIT_MAX_LEN
From: Theodore Ts'o
Date: Thu Nov 19 2026 - 09:49:49 EST
On Thu, 10 Sep 2026 11:40:00 +0800, Yichong Chen wrote:
> update_extent_range() keeps merging physically and logically contiguous
> blocks without limiting the accumulated range. The maximum length of an
> initialized extent is EXT_INIT_MAX_LEN, because the MSB of the 16-bit
> ee_len field is used to mark unwritten extents.
>
> finish_range() can therefore store a range longer than EXT_INIT_MAX_LEN
> in ee_len. A range of 32769 blocks is stored as 0x8001, which
> ext4_ext_is_unwritten() treats as an unwritten extent and
> ext4_ext_get_actual_len() reports as 1 block, so the migrated file
> silently loses its data.
>
> [...]
Applied, thanks!
[1/1] ext4: cap migration extent length at EXT_INIT_MAX_LEN
commit: b0a3f2c102e8c718e03be45f831e279ba9f6b112
Best regards,
--
Theodore Ts'o <tytso@xxxxxxx>