Re: gcc-8: mm/swapfile.c:863:40: error: array subscript 1 is above array bounds of 'struct list_head[1]' [-Werror=array-bounds]
From: Naresh Kamboju
Date: Mon Aug 19 2024 - 15:58:05 EST
On Mon, 19 Aug 2024 at 17:14, Kairui Song <ryncsn@xxxxxxxxx> wrote:
>
> On Mon, Aug 19, 2024 at 6:16 PM Naresh Kamboju
> <naresh.kamboju@xxxxxxxxxx> wrote:
> >
> > On Mon, 19 Aug 2024 at 13:58, Naresh Kamboju <naresh.kamboju@xxxxxxxxxx> wrote:
> > >
> > > The x86 builds failed with gcc-8 due to following build warnings / errors on
> > > Linux next-20240802 to next-20240819.
> > >
> > > x86_64 defconfig gcc-8 build failed
> > > x86_64 defconfig gcc-13 build pass
> > >
> > > First seen on the next-20240802 tag.
> > >
> > > GOOD: next-20240730
> > > BAD: next-20240802
> >
> > Anders bisected this and found the first bad commit id as,
> > aded4352f648 ("mm: swap: separate SSD allocation from
> > scan_swap_map_slots()") first faulty one
> >
> > - Naresh
> >
>
> Hi Naresh,
>
> Thanks for the report, the problem will occur when CONFIG_THP_SWAP is
> disabled. Can you try the following patch? I can confirm it's fixed
> with my test.
Thanks for the patch.
I have tested your patch and it fixes the reported problem.
Tested-by: Linux Kernel Functional Testing <lkft@xxxxxxxxxx>
- Naresh