Skip to content

Commit 4335c44

Browse files
nathanchancekdave
authored andcommitted
btrfs: fix PAGE_SIZE format specifier in open_ctree()
There is an instance of -Wformat when targeting 32-bit architectures due to using a 'size_t' specifier (which is 'unsigned int' for 32-bit platforms) to print PAGE_SIZE: In file included from fs/btrfs/compression.h:17, from fs/btrfs/extent_io.h:15, from fs/btrfs/locking.h:13, from fs/btrfs/ctree.h:19, from fs/btrfs/disk-io.c:22: fs/btrfs/disk-io.c: In function 'open_ctree': include/linux/kern_levels.h:5:25: error: format '%zu' expects argument of type 'size_t', but argument 4 has type 'long unsigned int' [-Werror=format=] ... fs/btrfs/disk-io.c:3398:17: note: in expansion of macro 'btrfs_warn' 3398 | btrfs_warn(fs_info, | ^~~~~~~~~~ PAGE_SIZE is consistently defined as an 'unsigned long' in include/vsdo/page.h so use '%lu' to clear up the warning. Fixes: 98077f7 ("btrfs: enable experimental bs > ps support") Reviewed-by: Qu Wenruo <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent dff4f9f commit 4335c44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/disk-io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3396,7 +3396,7 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device
33963396

33973397
if (fs_info->sectorsize > PAGE_SIZE)
33983398
btrfs_warn(fs_info,
3399-
"support for block size %u with page size %zu is experimental, some features may be missing",
3399+
"support for block size %u with page size %lu is experimental, some features may be missing",
34003400
fs_info->sectorsize, PAGE_SIZE);
34013401
/*
34023402
* Handle the space caching options appropriately now that we have the

0 commit comments

Comments
 (0)