From: Sandeep Dhavale Date: Wed, 30 Aug 2023 23:16:05 +0000 (-0700) Subject: erofs-utils: Relax the hardchecks on the blocksize X-Git-Tag: v1.8~193 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=20dba2d320e6ca7da692d059c4a424a59a70a6b0;p=platform%2Fupstream%2Ferofs-utils.git erofs-utils: Relax the hardchecks on the blocksize As erofs-utils supports different block sizes upto EROFS_MAX_BLOCK_SIZE, relax the checks so same tools can be used to create images for platforms where page size can be greater than 4096. Signed-off-by: Sandeep Dhavale Link: https://lore.kernel.org/r/20230830231606.3783734-1-dhavale@google.com [ Gao Xiang: refine the warning message. ] Signed-off-by: Gao Xiang --- diff --git a/lib/namei.c b/lib/namei.c index 2bb1d4c..45dbcd3 100644 --- a/lib/namei.c +++ b/lib/namei.c @@ -144,8 +144,6 @@ int erofs_read_inode_from_disk(struct erofs_inode *vi) vi->u.chunkbits = sbi->blkszbits + (vi->u.chunkformat & EROFS_CHUNK_FORMAT_BLKBITS_MASK); } else if (erofs_inode_is_data_compressed(vi->datalayout)) { - if (erofs_blksiz(vi->sbi) != EROFS_MAX_BLOCK_SIZE) - return -EOPNOTSUPP; return z_erofs_fill_inode(vi); } return 0; diff --git a/mkfs/main.c b/mkfs/main.c index 843a658..7225c40 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -565,11 +565,12 @@ static int mkfs_parse_options_cfg(int argc, char *argv[]) cfg.c_dbg_lvl = EROFS_ERR; cfg.c_showprogress = false; } - if (cfg.c_compr_alg[0] && erofs_blksiz(&sbi) != EROFS_MAX_BLOCK_SIZE) { - erofs_err("compression is unsupported for now with block size %u", - erofs_blksiz(&sbi)); - return -EINVAL; - } + + if (cfg.c_compr_alg[0] && erofs_blksiz(&sbi) != getpagesize()) + erofs_warn("Please note that subpage blocksize with compression isn't yet supported in kernel. " + "This compressed image will only work with bs = ps = %u bytes", + erofs_blksiz(&sbi)); + if (pclustersize_max) { if (pclustersize_max < erofs_blksiz(&sbi) || pclustersize_max % erofs_blksiz(&sbi)) {