summaryrefslogtreecommitdiff
path: root/.clang-format
diff options
context:
space:
mode:
authorSheng Yong <shengyong@oppo.com>2023-06-12 06:01:16 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-02-16 21:06:31 +0300
commitcf3d57ad6ff8b566deba3544b9ad3384781fb604 (patch)
treeda1b8a87540f4ee8f2d5ba802d513c34678c30e3 /.clang-format
parent9f74b3d7183aff25589728c484049991f187cb01 (diff)
downloadlinux-cf3d57ad6ff8b566deba3544b9ad3384781fb604.tar.xz
f2fs: add helper to check compression level
commit c571fbb5b59a3741e48014faa92c2f14bc59fe50 upstream. This patch adds a helper function to check if compression level is valid. Meanwhile, this patch fixes a reported issue [1]: The issue is easily reproducible by: 1. dd if=/dev/zero of=test.img count=100 bs=1M 2. mkfs.f2fs -f -O compression,extra_attr ./test.img 3. mount -t f2fs -o compress_algorithm=zstd:6,compress_chksum,atgc,gc_merge,lazytime ./test.img /mnt resulting in [ 60.789982] F2FS-fs (loop0): invalid zstd compress level: 6 A bugzilla report has been submitted in https://bugzilla.kernel.org/show_bug.cgi?id=218471 [1] https://lore.kernel.org/lkml/ZcWDOjKEnPDxZ0Or@google.com/T/ The root cause is commit 00e120b5e4b5 ("f2fs: assign default compression level") tries to check low boundary of compress level w/ zstd_min_clevel(), however, since commit e0c1b49f5b67 ("lib: zstd: Upgrade to latest upstream zstd version 1.4.10"), zstd supports negative compress level, it cast type for negative value returned from zstd_min_clevel() to unsigned int in below check condition, result in repored issue. if (level < zstd_min_clevel() || ... This patch fixes this issue by casting type for level to int before comparison. Fixes: 00e120b5e4b5 ("f2fs: assign default compression level") Signed-off-by: Sheng Yong <shengyong@oppo.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to '.clang-format')
0 files changed, 0 insertions, 0 deletions