• Chao Yu's avatar
    f2fs: compress: fix to check zstd compress level correctly in mount option · e39602da
    Chao Yu authored
    f2fs only support to config zstd compress level w/ a positive number due
    to layout design, but since commit e0c1b49f ("lib: zstd: Upgrade to
    latest upstream zstd version 1.4.10"), zstd supports negative compress
    level, so that zstd_min_clevel() may return a negative number, then w/
    below mount option, .compress_level can be configed w/ a negative number,
    which is not allowed to f2fs, let's add check condition to avoid it.
    
    mount -o compress_algorithm=zstd:4294967295 /dev/sdx /mnt/f2fs
    
    Fixes: 00e120b5 ("f2fs: assign default compression level")
    Signed-off-by: default avatarChao Yu <chao@kernel.org>
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    e39602da
super.c 130 KB