mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-04-13 09:59:31 +00:00
f2fs: Fix format specifier in sanity_check_inode()
When building for 32-bit platforms, for which 'size_t' is 'unsigned int',
there is a warning due to an incorrect format specifier:
fs/f2fs/inode.c:320:6: error: format specifies type 'unsigned long' but the argument has type 'unsigned int' [-Werror,-Wformat]
318 | f2fs_warn(sbi, "%s: inode (ino=%lx) has corrupted i_inline_xattr_size: %d, min: %lu, max: %lu",
| ~~~
| %u
319 | __func__, inode->i_ino, fi->i_inline_xattr_size,
320 | MIN_INLINE_XATTR_SIZE, MAX_INLINE_XATTR_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~
fs/f2fs/f2fs.h:1855:46: note: expanded from macro 'f2fs_warn'
1855 | f2fs_printk(sbi, false, KERN_WARNING fmt, ##__VA_ARGS__)
| ~~~ ^~~~~~~~~~~
fs/f2fs/xattr.h:86:31: note: expanded from macro 'MIN_INLINE_XATTR_SIZE'
86 | #define MIN_INLINE_XATTR_SIZE (sizeof(struct f2fs_xattr_header) / sizeof(__le32))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the format specifier for 'size_t', '%zu', to resolve the warning.
Fixes: 5c1768b672
("f2fs: fix to do sanity check correctly on i_inline_xattr_size")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
e02938613e
commit
a68905d48a
1 changed files with 1 additions and 1 deletions
|
@ -315,7 +315,7 @@ static bool sanity_check_inode(struct inode *inode, struct page *node_page)
|
||||||
f2fs_has_inline_xattr(inode) &&
|
f2fs_has_inline_xattr(inode) &&
|
||||||
(fi->i_inline_xattr_size < MIN_INLINE_XATTR_SIZE ||
|
(fi->i_inline_xattr_size < MIN_INLINE_XATTR_SIZE ||
|
||||||
fi->i_inline_xattr_size > MAX_INLINE_XATTR_SIZE)) {
|
fi->i_inline_xattr_size > MAX_INLINE_XATTR_SIZE)) {
|
||||||
f2fs_warn(sbi, "%s: inode (ino=%lx) has corrupted i_inline_xattr_size: %d, min: %lu, max: %lu",
|
f2fs_warn(sbi, "%s: inode (ino=%lx) has corrupted i_inline_xattr_size: %d, min: %zu, max: %lu",
|
||||||
__func__, inode->i_ino, fi->i_inline_xattr_size,
|
__func__, inode->i_ino, fi->i_inline_xattr_size,
|
||||||
MIN_INLINE_XATTR_SIZE, MAX_INLINE_XATTR_SIZE);
|
MIN_INLINE_XATTR_SIZE, MAX_INLINE_XATTR_SIZE);
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue