linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs: fix format string warning
@ 2019-12-10 20:44 Arnd Bergmann
  2019-12-10 20:47 ` Josef Bacik
  2019-12-13 12:32 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2019-12-10 20:44 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, David Sterba, Qu Wenruo
  Cc: Arnd Bergmann, Johannes Thumshirn, linux-btrfs, linux-kernel

To print a size_t, the format string modifier %z should be used instead
of %l:

fs/btrfs/tree-checker.c: In function 'check_extent_data_item':
fs/btrfs/tree-checker.c:230:43: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Werror=format=]
     "invalid item size, have %u expect [%lu, %u)",
                                         ~~^
                                         %u

Fixes: 153a6d299956 ("btrfs: tree-checker: Check item size before reading file extent type")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/btrfs/tree-checker.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
index 493d4d9e0f79..092b8ece36d7 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -227,7 +227,7 @@ static int check_extent_data_item(struct extent_buffer *leaf,
 	 */
 	if (item_size < BTRFS_FILE_EXTENT_INLINE_DATA_START) {
 		file_extent_err(leaf, slot,
-				"invalid item size, have %u expect [%lu, %u)",
+				"invalid item size, have %u expect [%zu, %u)",
 				item_size, BTRFS_FILE_EXTENT_INLINE_DATA_START,
 				SZ_4K);
 		return -EUCLEAN;
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: fix format string warning
  2019-12-10 20:44 [PATCH] btrfs: fix format string warning Arnd Bergmann
@ 2019-12-10 20:47 ` Josef Bacik
  2019-12-13 12:32 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Josef Bacik @ 2019-12-10 20:47 UTC (permalink / raw)
  To: Arnd Bergmann, Chris Mason, David Sterba, Qu Wenruo
  Cc: Johannes Thumshirn, linux-btrfs, linux-kernel

On 12/10/19 3:44 PM, Arnd Bergmann wrote:
> To print a size_t, the format string modifier %z should be used instead
> of %l:
> 
> fs/btrfs/tree-checker.c: In function 'check_extent_data_item':
> fs/btrfs/tree-checker.c:230:43: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Werror=format=]
>       "invalid item size, have %u expect [%lu, %u)",
>                                           ~~^
>                                           %u
> 
> Fixes: 153a6d299956 ("btrfs: tree-checker: Check item size before reading file extent type")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: fix format string warning
  2019-12-10 20:44 [PATCH] btrfs: fix format string warning Arnd Bergmann
  2019-12-10 20:47 ` Josef Bacik
@ 2019-12-13 12:32 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2019-12-13 12:32 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Chris Mason, Josef Bacik, David Sterba, Qu Wenruo,
	Johannes Thumshirn, linux-btrfs, linux-kernel

On Tue, Dec 10, 2019 at 09:44:16PM +0100, Arnd Bergmann wrote:
> To print a size_t, the format string modifier %z should be used instead
> of %l:
> 
> fs/btrfs/tree-checker.c: In function 'check_extent_data_item':
> fs/btrfs/tree-checker.c:230:43: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Werror=format=]
>      "invalid item size, have %u expect [%lu, %u)",
>                                          ~~^
>                                          %u
> 
> Fixes: 153a6d299956 ("btrfs: tree-checker: Check item size before reading file extent type")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks, there's already fix for that in our devel queue, I'm going to
send it to the next rc.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-13 20:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-10 20:44 [PATCH] btrfs: fix format string warning Arnd Bergmann
2019-12-10 20:47 ` Josef Bacik
2019-12-13 12:32 ` David Sterba

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).