* [PATCH] btrfs: Fix PAGE_SIZE format specifier in open_ctree()
@ 2025-09-25 23:03 Nathan Chancellor
2025-09-25 23:53 ` Qu Wenruo
2025-09-26 6:54 ` David Sterba
0 siblings, 2 replies; 4+ messages in thread
From: Nathan Chancellor @ 2025-09-25 23:03 UTC (permalink / raw)
To: Chris Mason, David Sterba, Qu Wenruo
Cc: linux-btrfs, patches, Nathan Chancellor
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: 98077f7f2180 ("btrfs: enable experimental bs > ps support")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
fs/btrfs/disk-io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 21c2a19d690f..f475fb2272ac 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3396,7 +3396,7 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device
if (fs_info->sectorsize > PAGE_SIZE)
btrfs_warn(fs_info,
- "support for block size %u with page size %zu is experimental, some features may be missing",
+ "support for block size %u with page size %lu is experimental, some features may be missing",
fs_info->sectorsize, PAGE_SIZE);
/*
* Handle the space caching options appropriately now that we have the
---
base-commit: d54be55d7a5eb9ee0a758580079adb2808d71a25
change-id: 20250925-btrfs-fix-page_size-format-specifier-21a9ac6569fe
Best regards,
--
Nathan Chancellor <nathan@kernel.org>
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] btrfs: Fix PAGE_SIZE format specifier in open_ctree()
2025-09-25 23:03 [PATCH] btrfs: Fix PAGE_SIZE format specifier in open_ctree() Nathan Chancellor
@ 2025-09-25 23:53 ` Qu Wenruo
2025-09-26 6:54 ` David Sterba
1 sibling, 0 replies; 4+ messages in thread
From: Qu Wenruo @ 2025-09-25 23:53 UTC (permalink / raw)
To: Nathan Chancellor, Chris Mason, David Sterba, Qu Wenruo
Cc: linux-btrfs, patches
在 2025/9/26 08:33, Nathan Chancellor 写道:
> 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: 98077f7f2180 ("btrfs: enable experimental bs > ps support")
The commit hash is not yet determined as the PR is not merged.
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Yep, we noticed that through the recent bot reports, and unfortunately
it's too late to fold a fix into it due to the code freezing period.
If Torvalds rejected the merge due to this, we will have time to fold
the fix into the offending patch.
Thanks,
Qu
> ---
> fs/btrfs/disk-io.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 21c2a19d690f..f475fb2272ac 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -3396,7 +3396,7 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device
>
> if (fs_info->sectorsize > PAGE_SIZE)
> btrfs_warn(fs_info,
> - "support for block size %u with page size %zu is experimental, some features may be missing",
> + "support for block size %u with page size %lu is experimental, some features may be missing",
> fs_info->sectorsize, PAGE_SIZE);
> /*
> * Handle the space caching options appropriately now that we have the
>
> ---
> base-commit: d54be55d7a5eb9ee0a758580079adb2808d71a25
> change-id: 20250925-btrfs-fix-page_size-format-specifier-21a9ac6569fe
>
> Best regards,
> --
> Nathan Chancellor <nathan@kernel.org>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] btrfs: Fix PAGE_SIZE format specifier in open_ctree()
2025-09-25 23:03 [PATCH] btrfs: Fix PAGE_SIZE format specifier in open_ctree() Nathan Chancellor
2025-09-25 23:53 ` Qu Wenruo
@ 2025-09-26 6:54 ` David Sterba
2025-10-01 14:02 ` Geert Uytterhoeven
1 sibling, 1 reply; 4+ messages in thread
From: David Sterba @ 2025-09-26 6:54 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Chris Mason, David Sterba, Qu Wenruo, linux-btrfs, patches
On Thu, Sep 25, 2025 at 07:03:04PM -0400, Nathan Chancellor wrote:
> 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: 98077f7f2180 ("btrfs: enable experimental bs > ps support")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Thanks, I'm planning to send it as fixup once the main pull request is
merged, until then it'll be in linux-next.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] btrfs: Fix PAGE_SIZE format specifier in open_ctree()
2025-09-26 6:54 ` David Sterba
@ 2025-10-01 14:02 ` Geert Uytterhoeven
0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2025-10-01 14:02 UTC (permalink / raw)
To: dsterba; +Cc: clm, dsterba, linux-btrfs, nathan, patches, wqu,
Geert Uytterhoeven
Hi David,
On Fri, 26 Sep 2025 at 08:54:01 +0200, David Sterba wrote:
> On Thu, Sep 25, 2025 at 07:03:04PM -0400, Nathan Chancellor wrote:
> > 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: 98077f7f2180 ("btrfs: enable experimental bs > ps support")
> > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
>
> Thanks, I'm planning to send it as fixup once the main pull request is
> merged, until then it'll be in linux-next.
The build failure is now upstream, and I can confirm this patch
fixes it, so
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Thanks!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-10-01 14:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-25 23:03 [PATCH] btrfs: Fix PAGE_SIZE format specifier in open_ctree() Nathan Chancellor
2025-09-25 23:53 ` Qu Wenruo
2025-09-26 6:54 ` David Sterba
2025-10-01 14:02 ` Geert Uytterhoeven
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).