Message ID | 20180724093509.1637386-1-arnd@arndb.de |
---|---|
State | New |
Headers | show |
Series | f2fs: fix 32-bit format string warning | expand |
On 2018/7/24 17:34, Arnd Bergmann wrote: > On 32-bit targets, size_t is often 'unsigned int', so printing it as %lu > causes a warning: > > fs/f2fs/inode.c: In function 'sanity_check_inode': > fs/f2fs/inode.c:247:4: error: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'unsigned int' [-Werror=format=] > > The correct format string is %zu. > > Fixes: ba3a252d3367 ("f2fs: fix to do sanity check with i_extra_isize") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> I noticed the issue, thank you for fixing it, but original buggy patch has not been upstreamed yet, how about merging this fix into origial patch, if you don't mind? Thanks, > --- > fs/f2fs/inode.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c > index 3fe63b0c7325..4fd339fd3ff2 100644 > --- a/fs/f2fs/inode.c > +++ b/fs/f2fs/inode.c > @@ -245,7 +245,7 @@ static bool sanity_check_inode(struct inode *inode, struct page *node_page) > set_sbi_flag(sbi, SBI_NEED_FSCK); > f2fs_msg(sbi->sb, KERN_WARNING, > "%s: inode (ino=%lx) has corrupted i_extra_isize: %d, " > - "max: %lu", > + "max: %zu", > __func__, inode->i_ino, fi->i_extra_isize, > F2FS_TOTAL_EXTRA_ATTR_SIZE); > return false; >
On Wed, Jul 25, 2018 at 5:21 PM, Chao Yu <chao@kernel.org> wrote: > On 2018/7/24 17:34, Arnd Bergmann wrote: >> On 32-bit targets, size_t is often 'unsigned int', so printing it as %lu >> causes a warning: >> >> fs/f2fs/inode.c: In function 'sanity_check_inode': >> fs/f2fs/inode.c:247:4: error: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'unsigned int' [-Werror=format=] >> >> The correct format string is %zu. >> >> Fixes: ba3a252d3367 ("f2fs: fix to do sanity check with i_extra_isize") >> Signed-off-by: Arnd Bergmann <arnd@arndb.de> > > I noticed the issue, thank you for fixing it, but original buggy patch has not > been upstreamed yet, how about merging this fix into origial patch, if you don't > mind? Yes, please do that. Arnd
On 07/25, Arnd Bergmann wrote: > On Wed, Jul 25, 2018 at 5:21 PM, Chao Yu <chao@kernel.org> wrote: > > On 2018/7/24 17:34, Arnd Bergmann wrote: > >> On 32-bit targets, size_t is often 'unsigned int', so printing it as %lu > >> causes a warning: > >> > >> fs/f2fs/inode.c: In function 'sanity_check_inode': > >> fs/f2fs/inode.c:247:4: error: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'unsigned int' [-Werror=format=] > >> > >> The correct format string is %zu. > >> > >> Fixes: ba3a252d3367 ("f2fs: fix to do sanity check with i_extra_isize") > >> Signed-off-by: Arnd Bergmann <arnd@arndb.de> > > > > I noticed the issue, thank you for fixing it, but original buggy patch has not > > been upstreamed yet, how about merging this fix into origial patch, if you don't > > mind? > > Yes, please do that. Squashed. Thank you. > > Arnd
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 3fe63b0c7325..4fd339fd3ff2 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -245,7 +245,7 @@ static bool sanity_check_inode(struct inode *inode, struct page *node_page) set_sbi_flag(sbi, SBI_NEED_FSCK); f2fs_msg(sbi->sb, KERN_WARNING, "%s: inode (ino=%lx) has corrupted i_extra_isize: %d, " - "max: %lu", + "max: %zu", __func__, inode->i_ino, fi->i_extra_isize, F2FS_TOTAL_EXTRA_ATTR_SIZE); return false;
On 32-bit targets, size_t is often 'unsigned int', so printing it as %lu causes a warning: fs/f2fs/inode.c: In function 'sanity_check_inode': fs/f2fs/inode.c:247:4: error: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'unsigned int' [-Werror=format=] The correct format string is %zu. Fixes: ba3a252d3367 ("f2fs: fix to do sanity check with i_extra_isize") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- fs/f2fs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.18.0