Commit 8f6ecc84 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Stefan Bader

btrfs: tree-checker: use %zu format string for size_t

BugLink: https://bugs.launchpad.net/bugs/1818237

commit 7cfad652 upstream.

The return value of sizeof() is of type size_t, so we must print it
using the %z format modifier rather than %l to avoid this warning
on some architectures:

fs/btrfs/tree-checker.c: In function 'check_dir_item':
fs/btrfs/tree-checker.c:273:50: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'u32' {aka 'unsigned int'} [-Werror=format=]

Fixes: 005887f2e3e0 ("btrfs: tree-checker: Add checker for dir item")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 38c8279a
...@@ -223,7 +223,7 @@ static int check_dir_item(struct btrfs_root *root, ...@@ -223,7 +223,7 @@ static int check_dir_item(struct btrfs_root *root,
/* header itself should not cross item boundary */ /* header itself should not cross item boundary */
if (cur + sizeof(*di) > item_size) { if (cur + sizeof(*di) > item_size) {
dir_item_err(root, leaf, slot, dir_item_err(root, leaf, slot,
"dir item header crosses item boundary, have %lu boundary %u", "dir item header crosses item boundary, have %zu boundary %u",
cur + sizeof(*di), item_size); cur + sizeof(*di), item_size);
return -EUCLEAN; return -EUCLEAN;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment