aboutsummaryrefslogtreecommitdiff
path: root/fs/erofs/erofs_fs.h
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@linux.alibaba.com>2024-09-12 15:41:56 +0800
committerGao Xiang <hsiangkao@linux.alibaba.com>2024-09-12 23:00:09 +0800
commit7c3ca1838a7831855cbf2e6927a10e0e4723edf6 (patch)
treeecdcfadd129552f99178ced9ef11a890bdaa63c3 /fs/erofs/erofs_fs.h
parent79f504a2cd3c0b7d953d0015618a2a41559a2cfd (diff)
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. Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: https://lore.kernel.org/r/20240912074156.2925394-1-hsiangkao@linux.alibaba.com
Diffstat (limited to 'fs/erofs/erofs_fs.h')
-rw-r--r--fs/erofs/erofs_fs.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/erofs/erofs_fs.h b/fs/erofs/erofs_fs.h
index 6c0c270c42e1..c8f2ae845bd2 100644
--- a/fs/erofs/erofs_fs.h
+++ b/fs/erofs/erofs_fs.h
@@ -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,