[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250224141938.GB1088@lst.de>
Date: Mon, 24 Feb 2025 15:19:38 +0100
From: Christoph Hellwig <hch@....de>
To: "Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc: Christoph Hellwig <hch@....de>, Sagi Grimberg <sagi@...mberg.me>,
Chaitanya Kulkarni <kch@...dia.com>, linux-nvme@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH 6/8][next] nvme: target: Avoid
-Wflex-array-member-not-at-end warnings
On Mon, Feb 24, 2025 at 08:30:10PM +1030, Gustavo A. R. Silva wrote:
> -Wflex-array-member-not-at-end was introduced in GCC-14, and we are
> getting ready to enable it, globally.
>
> Change the type of the middle struct members currently causing trouble
> from `struct bio` to `struct bio_hdr`.
>
> We also use `container_of()` whenever we need to retrieve a pointer to
> the flexible structure `struct bio`, through which we can access the
> flexible-array member in it, if necessary.
>
> With these changes fix 38 of the following warnings:
>
> drivers/nvme/target/nvmet.h:455:49: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
> drivers/nvme/target/nvmet.h:462:49: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
>
I'm not sure where you bio_hdr structure comes from, but maybe that's
because you annoyingly split CC over the series, and by the number of
patches probably also bundled unrelated changes.
In general our first resort here should be to move embedded bio to the
of containing structures. If that's not possible you'll need to explain
why.
Powered by blists - more mailing lists