[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADVatmMc-ZjPj0oNEidG4JK+k6YZ7XXPmMCCuYe_fnJ83xV5pw@mail.gmail.com>
Date: Wed, 1 Nov 2023 05:18:01 +0000
From: Sudip Mukherjee <sudipm.mukherjee@...il.com>
To: Kent Overstreet <kent.overstreet@...ux.dev>
Cc: linux-bcachefs@...r.kernel.org, linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
regressions@...ts.linux.dev
Subject: Re: mainline build failure due to 5cfd69775eb5 ("bcachefs: Array
bounds fixes")
On Tue, 31 Oct 2023 at 22:24, Kent Overstreet <kent.overstreet@...ux.dev> wrote:
>
> On Tue, Oct 31, 2023 at 10:15:09PM +0000, Sudip Mukherjee (Codethink) wrote:
> > Hi All,
> >
> > The latest mainline kernel branch fails to build arm64 allmodconfig
> > with a native build on an arm64 host with the error:
> >
> > In file included from fs/bcachefs/btree_io.c:11:
> > fs/bcachefs/btree_update_interior.h: In function 'want_new_bset':
> > fs/bcachefs/btree_update_interior.h:274:36: error: array subscript 0 is outside the bounds of an interior zero-length array 'struct bkey_packed[0]' [-Werror=zero-length-bounds]
> > 274 | __bch_btree_u64s_remaining(c, b, &bne->keys.start[0]);
> > | ^~~~~~~~~~~~~~~~~~~
> > In file included from fs/bcachefs/bcachefs.h:206,
> > from fs/bcachefs/btree_io.c:3:
> > fs/bcachefs/bcachefs_format.h:2344:21: note: while referencing 'start'
> > 2344 | struct bkey_packed start[0];
> > | ^~~~~
> >
> > git bisect pointed to 5cfd69775eb5 ("bcachefs: Array bounds fixes").
> >
> > I will be happy to test any patch or provide any extra log if needed.
>
> Following patch should resolve everything:
Thanks, and I can confirm that fixes the build for me too on the arm hosts.
>
> -- >8 --
> From ad77f25f730ec9a0eb04be5adc591628654b85ae Mon Sep 17 00:00:00 2001
> From: Kent Overstreet <kent.overstreet@...ux.dev>
> Date: Tue, 31 Oct 2023 18:05:22 -0400
> Subject: [PATCH] bcachefs: Fix build errors with gcc 10
>
> gcc 10 seems to complain about array bounds in situations where gcc 11
> does not - curious.
>
> This unfortunately requires adding some casts for now; we may
> investigate getting rid of our __u64 _data[] VLA in a future patch so
> that our start[0] members can be VLAs.
>
> Reported-by: John Stoffel <john@...ffel.org>
> Signed-off-by: Kent Overstreet <kent.overstreet@...ux.dev>
Tested-by: Sudip Mukherjee <sudip.mukherjee@...ethink.co.uk>
--
Regards
Sudip
Powered by blists - more mailing lists