[PATCH] erofs-utils: fix battach on full buffer block

Gao Xiang hsiangkao at redhat.com
Wed Jan 20 02:43:35 AEDT 2021

Hi Weiwen,

On Tue, Jan 19, 2021 at 02:02:56PM +0800, 胡玮文 wrote:
> Hi Xiang,
> After further investgate, this bug will not reveal in any released version of
> mkfs.erofs. Previous patch v5 [1] will map all allocated bb when erofs_mapbh()
> is called on an already mapped bb, which triggers this bug. before that patch,
> under the same condition, __erofs_battach() will only be called on bb which is
> not mapped, thus no need to update `tail_blkaddr'.

Good to know this, thanks! I haven't looked into that (I will test it this
weekend.) IMO, although this is not a regression, yet it seems it's potential
harmful if we didn't notice this... So I think a proper testcase is still
useful to look after this... If you have extra time, could you help on it?

Also, without the detail of this, I think the fix might be folded into
the original patchset (could you resend it?). In addition, I think after
last_mapped_block is introduced, we might not need tail_blkaddr anymore,
not sure. But I'm very cautious about this in case of introducing any
new regression...

Gao Xiang

> [1]: https://lore.kernel.org/linux-erofs/20210118123431.22533-1-sehuww@mail.scut.edu.cn/
> Hu Weiwen

More information about the Linux-erofs mailing list