From b62f2af118c8c313a9028bfd346cb4cfa31274db Mon Sep 17 00:00:00 2001 From: Vaisakh Murali Date: Wed, 1 Mar 2023 12:27:17 +0000 Subject: [PATCH] ANDROID: fs/f2fs: fixup __f2fs_cluster_blocks with F2FS_FS_COMPRESSION Commit 3cf0f8245dbc54c81b8994d530e47232be36e5eb introduced `inode` as a parameter to F2FS_I_SB() but never declared from where it was supposed to be accessed from. This leads to a compile error with CONFIG_F2FS_FS_COMPRESSION enabled: In file included from fs/f2fs/compress.c:17: fs/f2fs/compress.c: In function '__f2fs_cluster_blocks': fs/f2fs/compress.c:813:39: error: 'inode' undeclared (first use in this function) 813 | f2fs_bug_on(F2FS_I_SB(inode), | ^~~~~ fs/f2fs/f2fs.h:38:38: note: in definition of macro 'f2fs_bug_on' 38 | set_sbi_flag(sbi, SBI_NEED_FSCK); \ | ^~~ fs/f2fs/compress.c:813:39: note: each undeclared identifier is reported only once for each function it appears in 813 | f2fs_bug_on(F2FS_I_SB(inode), | ^~~~~ fs/f2fs/f2fs.h:38:38: note: in definition of macro 'f2fs_bug_on' 38 | set_sbi_flag(sbi, SBI_NEED_FSCK); \ | Test: Enable CONFIG_F2FS_FS_COMPRESSION, check compile. Fixes: 3cf0f8245dbc54c81b8994d530e47232be36e5eb ("BACKPORT: f2fs: compress: remove unneeded preallocation") Change-Id: I40015a66b8b872c86ff782b30581b24f752bb19a Signed-off-by: Vaisakh Murali --- fs/f2fs/compress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index e8bd9d205ce6..fe74dafede84 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -810,7 +810,7 @@ static int __f2fs_cluster_blocks(struct compress_ctx *cc, bool compr) } } - f2fs_bug_on(F2FS_I_SB(inode), + f2fs_bug_on(F2FS_I_SB(cc->inode), !compr && ret != cc->cluster_size && !is_inode_flag_set(cc->inode, FI_COMPRESS_RELEASED)); }