Skip to content

Commit

Permalink
f2fs: Add inline to f2fs_build_fault_attr() stub
Browse files Browse the repository at this point in the history
commit 0d89682 upstream.

When building without CONFIG_F2FS_FAULT_INJECTION, there is a warning
from each file that includes f2fs.h because the stub for
f2fs_build_fault_attr() is missing inline:

  In file included from fs/f2fs/segment.c:21:
  fs/f2fs/f2fs.h:4605:12: warning: 'f2fs_build_fault_attr' defined but not used [-Wunused-function]
   4605 | static int f2fs_build_fault_attr(struct f2fs_sb_info *sbi, unsigned long rate,
        |            ^~~~~~~~~~~~~~~~~~~~~

Add the missing inline to resolve all of the warnings for this
configuration.

Fixes: 4ed886b ("f2fs: check validation of fault attrs in f2fs_build_fault_attr()")
Signed-off-by: Nathan Chancellor <[email protected]>
Reviewed-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
(cherry picked from commit 72d0e1dec7914b36beb4f3c7fe3a4c01cbb018ee linux-6.9.y)
CVE-2024-42160
Signed-off-by: Massimiliano Pellizzer <[email protected]>
Acked-by: Aaron Jauregui <[email protected]>
Acked-by: Kuan-Ying Lee <[email protected]>
Signed-off-by: Manuel Diewald <[email protected]>
  • Loading branch information
nathanchance authored and mdiewa committed Aug 28, 2024
1 parent 25ca97f commit f247a59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/f2fs/f2fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -4606,8 +4606,8 @@ static inline bool f2fs_need_verity(const struct inode *inode, pgoff_t idx)
extern int f2fs_build_fault_attr(struct f2fs_sb_info *sbi, unsigned long rate,
unsigned long type);
#else
static int f2fs_build_fault_attr(struct f2fs_sb_info *sbi, unsigned long rate,
unsigned long type)
static inline int f2fs_build_fault_attr(struct f2fs_sb_info *sbi,
unsigned long rate, unsigned long type)
{
return 0;
}
Expand Down

0 comments on commit f247a59

Please sign in to comment.