[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVbcfB0FFS=gLDathXFM3x0WYXJEq99S_g7mjAPS94rAQ@mail.gmail.com>
Date: Tue, 26 Nov 2019 11:36:58 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: David Sterba <dsterba@...e.cz>,
Andreas Färber <afaerber@...e.de>,
Qu Wenruo <wqu@...e.com>, David Sterba <dsterba@...e.com>,
Johannes Thumshirn <jthumshirn@...e.de>,
Chris Mason <clm@...com>, Josef Bacik <josef@...icpanda.com>,
linux-btrfs <linux-btrfs@...r.kernel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH next 1/2] btrfs: tree-checker: Fix error format string
Hi David,
On Mon, Nov 11, 2019 at 7:32 PM David Sterba <dsterba@...e.cz> wrote:
> On Fri, Nov 08, 2019 at 10:38:52PM +0100, Andreas Färber wrote:
> > From: Andreas Färber <afaerber@...e.com>
> >
> > Argument BTRFS_FILE_EXTENT_INLINE_DATA_START is defined as offsetof(),
> > which returns type size_t, so we need %zu instead of %lu.
> >
> > This fixes a build warning on 32-bit arm:
> >
> > ../fs/btrfs/tree-checker.c: In function 'check_extent_data_item':
> > ../fs/btrfs/tree-checker.c:230:43: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Wformat=]
> > 230 | "invalid item size, have %u expect [%lu, %u)",
> > | ~~^
> > | |
> > | long unsigned int
> > | %u
>
> Is there a gcc warning option that can catch that on 64bit too?
> -Wformat=2 does not and I don't see any other of the option family to do
> that. We've had fixups of the size_t printk formats and I'd like to
> catch that when the patches are added to the devel branches. I can't run
> 32bit build check each time but this seems to be the only way so far.
Yep. On 64-bit, size_t _is_ unsigned long.
So you have to compile for both 32-bit and 64-bit.
Acked-by: Geert Uytterhoeven <geert@...ux-m68k.org>
> > Fixes: a31ccb4b7ba2 ("btrfs: tree-checker: Check item size before reading file extent type")
>
> As the patch is still in the devel branch, the commit id is not stable
It indeed is not:
Fixes: 153a6d299956983d ("btrfs: tree-checker: Check item size before
reading file extent type")
> and I'll fold the change to to the patch. Thanks.
Apparently that was forgotten, and now the issue is part of Linus' tree.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-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
Powered by blists - more mailing lists