]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
f2fs: compress: fix to print raw data size in error path of lz4 decompression
authorChao Yu <chao@kernel.org>
Wed, 16 Mar 2022 10:20:00 +0000 (18:20 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 12:39:48 +0000 (14:39 +0200)
BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit d284af43f703760e261b1601378a0c13a19d5f1f ]

In lz4_decompress_pages(), if size of decompressed data is not equal to
expected one, we should print the size rather than size of target buffer
for decompressed data, fix it.

Signed-off-by: Chao Yu <chao.yu@oppo.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 1a55c48bba8161b417efa3a2580e56602d161d9d)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
fs/f2fs/compress.c

index 58d255d3a518ac436e1d8dfa1a4b25d809b5a95f..6adf0472595462c2bf3612603c6aec2b77872821 100644 (file)
@@ -312,10 +312,9 @@ static int lz4_decompress_pages(struct decompress_io_ctx *dic)
        }
 
        if (ret != PAGE_SIZE << dic->log_cluster_size) {
-               printk_ratelimited("%sF2FS-fs (%s): lz4 invalid rlen:%zu, "
+               printk_ratelimited("%sF2FS-fs (%s): lz4 invalid ret:%d, "
                                        "expected:%lu\n", KERN_ERR,
-                                       F2FS_I_SB(dic->inode)->sb->s_id,
-                                       dic->rlen,
+                                       F2FS_I_SB(dic->inode)->sb->s_id, ret,
                                        PAGE_SIZE << dic->log_cluster_size);
                return -EIO;
        }