[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aa568cd4-3bfc-4eac-8a49-eb4cf7cf7331@embeddedor.com>
Date: Tue, 26 Aug 2025 06:43:55 +0200
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To: Jason Gunthorpe <jgg@...dia.com>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc: Leon Romanovsky <leon@...nel.org>, linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH v2][next] RDMA/cm: Avoid -Wflex-array-member-not-at-end
warning
On 25/08/25 19:20, Jason Gunthorpe wrote:
> On Wed, Aug 13, 2025 at 07:22:14PM +0900, Gustavo A. R. Silva wrote:
>
>> @@ -1866,7 +1872,7 @@ static void cm_process_work(struct cm_id_private *cm_id_priv,
>> int ret;
>
> I think if you are going to do this restructing then these lower level
> functions that never touch the path member should also have their
> signatures updated to take in the cm_work_hdr not the cm_work struct
> with the path, and we should never cast from a cm_work_hdr to a
> cm_work.
>
> Basically we should have more type clarity when the path touches are
> to be sure the cm_timewait_info version never gets into there.
>
> And to do that properly is going to need a preparing patch to untangle
> cm_work_handler() a little bit, it shouldn't be the work function for
> the cm_timewait_handler() which has a different ype.
>
> Also did you look closely at which members needed to be in the hdr?
> I think with the above it will turn out that some members can be moved
> to cm_work..
I was wondering if we could just move cm_work at the very end of
struct cm_timewait_info, like this:
struct cm_timewait_info {
- struct cm_work work;
struct list_head list;
struct rb_node remote_qp_node;
struct rb_node remote_id_node;
@@ -204,6 +203,7 @@ struct cm_timewait_info {
__be32 remote_qpn;
u8 inserted_remote_qp;
u8 inserted_remote_id;
+ struct cm_work work;
};
and then I found this commit 09fb406a569b ("RDMA/cm: Add a note explaining
how the timewait is eventually freed")
-Gustavo
Powered by blists - more mailing lists