Re: [PATCH] mm/vmscan: avoid false-positive -Wuninitialized warning
From: Andrew Morton
Date: Fri Feb 13 2026 - 12:23:48 EST
On Fri, 13 Feb 2026 18:07:04 +0100 "Arnd Bergmann" <arnd@xxxxxxxx> wrote:
> On Fri, Feb 13, 2026, at 17:58, Andrew Morton wrote:
> > On Fri, 13 Feb 2026 13:38:56 +0100 Arnd Bergmann <arnd@xxxxxxxxxx> wrote:
> >
> >> From: Arnd Bergmann <arnd@xxxxxxxx>
> >>
> >> When the -fsanitize=bounds sanitizer is enabled,
> >
> > Is this an option in current kernels?
>
> Yes, this is CONFIG_UBSAN_ARRAY_BOUNDS. The actual warning
> only shows up in some configurations with that, so either there
> is some other dependency, or an element of chance based on gcc
> optimizations.
OK, I'll put a cc:stable on this, as people will want to compile older
kernels with gcc-16.
Aiming for upstreaming into 7.1-rc1 unless it's more urgent than I
think.
> > Seems a large change just to squish a compiler warning. People might
> > prefer a simple
> >
> > - struct ctrl_pos sp, pv;
> > + struct ctrl_pos sp, pv = {};
>
> Right, that would clearly also shut up the warning.
>
> To me this seems less intuitive without an extra comment,
> since read_ctrl_pos() is meant to initialize the entire
> struct, but please pick whichever you find most readable
> here.
Let's see what the MGLRU maintainers have to say.