erofs-utils: zmap: fix small compressed files inlining
PATCH 1/1 erofs-utils: zmap: fix small compressed files inlining
From: Yue Hu <[email protected]>
Keep in sync with kernel commit 24331050a3e6 ("erofs: fix small compressed files inlining") to avoid corruption due to m_llen > m_plen for uncompressed pclusters.
Fixes 41790d24329d ("erofs-utils: validate the extent length for uncompressed pclusters")
Signed-off-by Yue Hu <[email protected]>
--- lib/zmap.c | 7 +++++++ 1 file changed, 7 insertions(+)
lib/zmap.c +7 -0
@@ -597,6 +597,13 @@ static int z_erofs_do_map_blocks(struct erofs_inode *vi,if (endoff >= m.clusterofs) { m.headtype = m.type; map->m_la = (m.lcn << lclusterbits) | m.clusterofs; +/* +* For ztailpacking files, in order to inline data more +* effectively, special EOF lclusters are now supported +* which can have three parts at most. +*/ +if (ztailpacking && end > vi->i_size) + end = vi->i_size;break ; }/* m.lcn should be >= 1 if endoff < m.clusterofs */
Signature · 1 line
2.17.1
Gao Xiang
AppliedQuoted 8 lines · Yue Hu
From: Yue Hu <[email protected]>
Keep in sync with kernel commit
24331050a3e6("erofs: fix small compressed files inlining") to avoid corruption due tom_llen>m_plenfor uncompressed pclusters.Fixes 41790d24329d ("erofs-utils: validate the extent length for uncompressed pclusters")Signed-off-by Yue Hu <[email protected]>
Thanks, applied.
Thanks,
Gao Xiang