]> git.hungrycats.org Git - linux/commit
erofs: relax sanity check for tail pclusters due to ztailpacking
authorGao Xiang <hsiangkao@linux.alibaba.com>
Wed, 8 Jul 2026 03:18:45 +0000 (11:18 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Sep 2026 11:36:18 +0000 (13:36 +0200)
commita295f239dee45ae5df025c2fc7f0702004748758
treeca9e7063c3db69fa9f419837a25856dc182ff014
parentbf8601feeb469f517054efa274ba39c1c811b244
erofs: relax sanity check for tail pclusters due to ztailpacking

[ Upstream commit d3386e17393bec1341cfeedb9d08d6846ccd6fb2 ]

If the tail data can be inlined into the inode meta block, it should
be converted into a regular tail pcluster.

In principle, it should be converted into an uncompressed pcluster if
there is not enough gain to use compression (map->m_llen < map->m_plen);
but since there are various shipped images, relax the condition for
ztailpacking tail pcluster fallback instead of reporting corruption
incorrectly.

Reported-and-tested-by: Yifan Zhao <zhaoyifan28@huawei.com>
Reported-by: Alberto Salvia Novella <es20490446e@gmail.com>
Closes: https://github.com/erofs/erofs-utils/issues/51
Fixes: a5242d37c83a ("erofs: error out obviously illegal extents in advance")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/erofs/zmap.c