From: "Andreas Färber" <afaerber@suse.de>
To: Qu Wenruo <wqu@suse.com>, David Sterba <dsterba@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>, Chris Mason <clm@fb.com>,
Josef Bacik <josef@toxicpanda.com>,
linux-btrfs@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH next 2/2] btrfs: extent-tree: Fix error format string
Date: Fri, 8 Nov 2019 22:38:53 +0100 [thread overview]
Message-ID: <20191108213853.16635-3-afaerber@suse.de> (raw)
In-Reply-To: <20191108213853.16635-1-afaerber@suse.de>
From: Andreas Färber <afaerber@suse.com>
sizeof() returns type size_t, thus we need %zu instead of %lu.
This fixes the following build warning on 32-bit arm:
In file included from ../include/linux/printk.h:7,
from ../include/linux/kernel.h:15,
from ../include/asm-generic/bug.h:19,
from ../arch/arm/include/asm/bug.h:60,
from ../include/linux/bug.h:5,
from ../include/linux/thread_info.h:12,
from ../include/asm-generic/current.h:5,
from ./arch/arm/include/generated/asm/current.h:1,
from ../include/linux/sched.h:12,
from ../fs/btrfs/extent-tree.c:6:
../fs/btrfs/extent-tree.c: In function '__btrfs_free_extent':
../include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 8 has type 'unsigned int' [-Wformat=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
../include/linux/kern_levels.h:10:19: note: in expansion of macro 'KERN_SOH'
10 | #define KERN_CRIT KERN_SOH "2" /* critical conditions */
| ^~~~~~~~
../fs/btrfs/ctree.h:2986:24: note: in expansion of macro 'KERN_CRIT'
2986 | btrfs_printk(fs_info, KERN_CRIT fmt, ##args)
| ^~~~~~~~~
../fs/btrfs/extent-tree.c:3207:4: note: in expansion of macro 'btrfs_crit'
3207 | btrfs_crit(info,
| ^~~~~~~~~~
../fs/btrfs/extent-tree.c:3208:83: note: format string is defined here
3208 | "invalid extent item size for key (%llu, %u, %llu) owner %llu, has %u expect >= %lu",
| ~~^
| |
| long unsigned int
| %u
Fixes: 0c171e9095e4 ("btrfs: extent-tree: Kill BUG_ON() in __btrfs_free_extent() and do better comment")
Cc: Qu Wenruo <wqu@suse.com>
Cc: David Sterba <dsterba@suse.com>
Signed-off-by: Andreas Färber <afaerber@suse.com>
---
fs/btrfs/extent-tree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 7c7a3e30e917..631c9743ddc7 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3205,7 +3205,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
struct btrfs_tree_block_info *bi;
if (unlikely(item_size < sizeof(*ei) + sizeof(*bi))) {
btrfs_crit(info,
-"invalid extent item size for key (%llu, %u, %llu) owner %llu, has %u expect >= %lu",
+"invalid extent item size for key (%llu, %u, %llu) owner %llu, has %u expect >= %zu",
key.objectid, key.type, key.offset,
owner_objectid, item_size,
sizeof(*ei) + sizeof(*bi));
--
2.16.4
prev parent reply other threads:[~2019-11-08 21:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-08 21:38 [PATCH next 0/2] btrfs: Fix build warnings for arm Andreas Färber
2019-11-08 21:38 ` [PATCH next 1/2] btrfs: tree-checker: Fix error format string Andreas Färber
2019-11-11 18:31 ` David Sterba
2019-11-26 10:36 ` Geert Uytterhoeven
2019-11-26 15:44 ` David Sterba
2019-11-08 21:38 ` Andreas Färber [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191108213853.16635-3-afaerber@suse.de \
--to=afaerber@suse.de \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=jthumshirn@suse.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wqu@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).