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 <dhavale@google.com>
Link: https://lore.kernel.org/r/20230830231606.3783734-1-dhavale@google.com
[ Gao Xiang: refine the warning message. ]
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
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;
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)) {