erofs: restrict pcluster size limitations
PATCH 1/1 erofs: restrict pcluster size limitations
Error out if {en,de}encoded size of a pcluster is unsupported:
Maximum supported encoded size (of a pcluster): 1 MiB Maximum supported decoded size (of a pcluster): 12 MiB
Users can still choose to use supported large configurations (e.g., for archival purposes), but there may be performance penalties in low-memory scenarios compared to smaller pclusters.
--- fs/erofs/erofs_fs.h | 5 ++++- fs/erofs/zmap.c | 42 ++++++++++++++++++++---------------------- 2 files changed, 24 insertions(+), 23 deletions(-)
fs/erofs/erofs_fs.h +4 -1
@@ -288,9 +288,12 @@ struct erofs_dirent {#define EROFS_NAME_LEN 255 -/* maximum supported size of a physical compression cluster */ +/* maximum supported encoded size of a physical compressed cluster */ #define Z_EROFS_PCLUSTER_MAX_SIZE (1024 * 1024) +/* maximum supported decoded size of a physical compressed cluster */ +#define Z_EROFS_PCLUSTER_MAX_DSIZE (12 * 1024 * 1024) +/* available compression algorithm types (for h_algorithmtype) */ enum {Z_EROFS_COMPRESSION_LZ4 =0 ,
fs/erofs/zmap.c +20 -22
52 lines not on this page · raw message
Signature · 1 line
2.43.5
Quoted 9 lines · Gao Xiang
Error out if {en,de}encoded size of a pcluster is unsupported:
Maximum supported encoded size (of a pcluster): 1 MiB Maximum supported decoded size (of a pcluster): 12 MiBUsers can still choose to use supported large configurations (e.g., for archival purposes), but there may be performance penalties in low-memory scenarios compared to smaller pclusters.
Signed-off-by Gao Xiang <[email protected]>
Thanks,