erofs-utils: lib: fix incorrect big pcluster judgment
PATCH 1/2 erofs-utils: lib: fix incorrect big pcluster judgment
params->pclusterblks_max should be greater than 1.
Fixes 0d0aa8522672 ("erofs-utils: lib: migrate pclustersize configurations")
Signed-off-by Gao Xiang <[email protected]>
--- lib/compress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/compress.c +1 -1
@@ -2130,7 +2130,7 @@ int z_erofs_compress_init(struct erofs_importer *im)* if big pcluster is enabled, an extra CBLKCNT lcluster index needs * to be loaded in order to get those compressed block counts. */ -if (params->pclusterblks_max) { +if (params->pclusterblks_max >1 ) {if (pclustersize_max >Z_EROFS_PCLUSTER_MAX_SIZE ) {erofs_err ("pcluster size (%u blocks) is too large" , params->pclusterblks_max);
Signature · 1 line
2.43.5
PATCH 2/2 erofs-utils: lib: handle duplicate dirents in incremental builds
Corrupted base images may contain duplicate dirents.
Fixes f64d9d02576b ("erofs-utils: introduce incremental builds")
Signed-off-by Gao Xiang <[email protected]>
--- lib/rebuild.c | 5 +++++ 1 file changed, 5 insertions(+)
lib/rebuild.c +5 -0
@@ -484,6 +484,11 @@ static int erofs_rebuild_basedir_dirent_iter(struct erofs_dir_context *ctx) d->validnid = true;if (!mergedir->whiteouts &&erofs_dentry_is_wht (dir->sbi, d)) mergedir->whiteouts = true; + }else if (__erofs_unlikely (d->validnid)) { +/* The base image appears to be corrupted */ +DBG_BUGON (1 ); + ret = -EFSCORRUPTED ; + goto out; }else {struct erofs_inode *inode = d->inode;
Signature · 1 line
2.43.5