btrfs: fix format string warning
PATCH 1/1 btrfs: fix format string warning
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--- fs/btrfs/tree-checker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/tree-checker.c +1 -1
@@ -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 ;
Signature · 1 line
2.20.0
Quoted 11 lines · Arnd Bergmann
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)", ~~^ %uFixes 153a6d299956 ("btrfs: tree-checker: Check item size before reading file extent type")Signed-off-by Arnd Bergmann <[email protected]>
Thanks,
Josef
Quoted 11 lines · Arnd Bergmann
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)", ~~^ %uFixes 153a6d299956 ("btrfs: tree-checker: Check item size before reading file extent type")Signed-off-by Arnd Bergmann <[email protected]>
Thanks, there's already fix for that in our devel queue, I'm going to send it to the next rc.