[ Sasha's backport helper bot ] Hi, The upstream commit SHA1 provided is correct: 1c7f49a76773bcf95d3c840cff6cd449114ddf56 Status in newer kernel trees: 6.12.y | Present (exact SHA1) 6.6.y | Present (exact SHA1) 6.1.y | Not found Note: The patch differs from the upstream commit: --- 1: 1c7f49a76773 ! 1: d53a213aa414 erofs: tidy up EROFS on-disk naming @@ Metadata ## Commit message ## erofs: tidy up EROFS on-disk naming + commit 1c7f49a76773bcf95d3c840cff6cd449114ddf56 upstream. + - Get rid of all "vle" (variable-length extents) expressions since they only expand overall name lengths unnecessarily; - Rename COMPRESSION_LEGACY to COMPRESSED_FULL; @@ Commit message No actual logical change. - Signed-off-by: Gao Xiang <hsiangkao@xxxxxxxxxxxxxxxxx> Reviewed-by: Yue Hu <huyue2@xxxxxxxxxxx> Reviewed-by: Chao Yu <chao@xxxxxxxxxx> Link: https://lore.kernel.org/r/20230331063149.25611-1-hsiangkao@xxxxxxxxxxxxxxxxx + [ A backport dependency to resolve minor conflicts to fix CVE-2024-53234. ] + Signed-off-by: Gao Xiang <hsiangkao@xxxxxxxxxxxxxxxxx> ## fs/erofs/erofs_fs.h ## @@ fs/erofs/erofs_fs.h: struct erofs_super_block { @@ fs/erofs/zmap.c: static int legacy_load_cluster_from_disk(struct z_erofs_mapreco + if (advise & Z_EROFS_LI_PARTIAL_REF) m->partialref = true; m->clusterofs = le16_to_cpu(di->di_clusterofs); - m->pblk = le32_to_cpu(di->di_u.blkaddr); + if (m->clusterofs >= 1 << vi->z_logical_clusterbits) { @@ fs/erofs/zmap.c: static int get_compacted_la_distance(unsigned int lclusterbits, lo = decode_compactedbits(lclusterbits, lomask, in, encodebits * i, &type); @@ fs/erofs/zmap.c: static int z_erofs_do_map_blocks(struct inode *inode, DBG_BUGON(1); err = -EFSCORRUPTED; @@ fs/erofs/zmap.c: static int z_erofs_do_map_blocks(struct inode *inode, - else - map->m_algorithmformat = - Z_EROFS_COMPRESSION_SHIFTED; -- } else if (m.headtype == Z_EROFS_VLE_CLUSTER_TYPE_HEAD2) { -+ } else if (m.headtype == Z_EROFS_LCLUSTER_TYPE_HEAD2) { - map->m_algorithmformat = vi->z_algorithmtype[1]; + Z_EROFS_COMPRESSION_INTERLACED : + Z_EROFS_COMPRESSION_SHIFTED; } else { - map->m_algorithmformat = vi->z_algorithmtype[0]; +- afmt = m.headtype == Z_EROFS_VLE_CLUSTER_TYPE_HEAD2 ? ++ afmt = m.headtype == Z_EROFS_LCLUSTER_TYPE_HEAD2 ? + vi->z_algorithmtype[1] : vi->z_algorithmtype[0]; + if (!(EROFS_I_SB(inode)->available_compr_algs & (1 << afmt))) { + erofs_err(inode->i_sb, "inconsistent algorithmtype %u for nid %llu", @@ fs/erofs/zmap.c: static int z_erofs_fill_inode_lazy(struct inode *inode) err = -EFSCORRUPTED; goto out_put_metabuf; --- Results of testing on various branches: | Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.1.y | Success | Success |