From: Gerd Rausch <gerd.rausch@oracle.com>
To: Allison Henderson <achender@kernel.org>,
henrymei <ljp1205831794@gmail.com>,
netdev@vger.kernel.org
Cc: linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com,
santosh.shilimkar@oracle.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
horms@kernel.org, Aohan Mei <henrymei@tencent.com>,
TencentOS Corvus AI <corvus@tencent.com>,
stable@vger.kernel.org
Subject: Re: [rds-devel] [External] : Re: [PATCH net] rds: ib: use rds_conn_drop() on protocol version mismatch
Date: Wed, 9 Sep 2026 10:25:59 -0700 [thread overview]
Message-ID: <10cf2701-211a-42fe-bb1b-c218d718ed2b@oracle.com> (raw)
In-Reply-To: <4fda023c1e7152aee2d5f977f5045dcddcd08d8d.camel@kernel.org>
Hi,
On 2026-09-09 00:09, Allison Henderson via rds-devel wrote:
> On Tue, 2026-09-08 at 20: 33 +0800, henrymei wrote: > From: Aohan Mei <henrymei@ tencent. com> > > rds_ib_cm_connect_complete() runs from the RDMA-CM event handler with > conn->c_cm_lock held. When the peer negotiates a protocol
> On Tue, 2026-09-08 at 20:33 +0800, henrymei wrote:
>> From: Aohan Mei <henrymei@tencent.com>
>>
>> rds_ib_cm_connect_complete() runs from the RDMA-CM event handler with
>> conn->c_cm_lock held. When the peer negotiates a protocol version
>> older than RDS_PROTOCOL_COMPAT_VERSION, the handler calls
>> rds_conn_destroy(), which is only safe in the rmmod path: it
>> synchronously tears the connection down and flush_work()es the
>> shutdown work cp_down_w.
>>
>> That shutdown work (rds_conn_shutdown()) needs cp_cm_lock, which is
>> the very lock the event handler still holds, so the flush never
>> completes: the two workers wait on each other and the RDS connection
>> workqueues stall for good.
>>
>> All other RDMA-CM failure paths (REJECTED, CONNECT_ERROR,
>> DISCONNECTED) use rds_conn_drop(), which marks the connection
>> RDS_CONN_ERROR and schedules the shutdown work asynchronously. Use
>> it here as well.
>>
I don't get this.
So RDS should just keep on retrying to connect every second instead
of giving up on that incompatible peer? Forever?
The version number the peer uses remains the same until it gets upgraded somehow.
I understand how the rds_conn_destroy() path is full of bugs.
But shouldn't that just mean those bugs ought to be fixed,
instead of no longer retiring any connection ever,
even to old & incompatible peers we can't really talk to?
Thanks,
Gerd
>> Fixes: cdc306a5c9cd ("rds: make v3.1 as compat version")
>
> Hi Aohan,
>
> Thanks for the catch, this looks correct to me. Just one nit on the
> fixes tag. I think we want: f147dd9ecabf ("RDS/IB: Disallow connections
> less than RDS 3.1"). That looks like the commit that added the
> rds_conn_destroy() call to the version check. Other than that, I think
> this patch looks good. With the Fixes tag corrected, you can add my rvb:
>
> Reviewed-by: Allison Henderson <achender@kernel.org>
>
> Thanks!
> Allison
>
>> Reported-by: TencentOS Corvus AI <corvus@tencent.com>
>> Cc: stable@vger.kernel.org
>> Assisted-by: CodeBuddy:Kimi-K3
>> Signed-off-by: Aohan Mei <henrymei@tencent.com>
>> ---
>> net/rds/ib_cm.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
>> index d46146887ba4..2909da8363f3 100644
>> --- a/net/rds/ib_cm.c
>> +++ b/net/rds/ib_cm.c
>> @@ -115,7 +115,7 @@ void rds_ib_cm_connect_complete(struct rds_connection *conn, struct rdma_cm_even
>> &conn->c_laddr, &conn->c_faddr,
>> RDS_PROTOCOL_MAJOR(conn->c_version),
>> RDS_PROTOCOL_MINOR(conn->c_version));
>> - rds_conn_destroy(conn);
>> + rds_conn_drop(conn);
>> return;
>> }
>> }
>
>
> _______________________________________________
> rds-devel mailing list
> rds-devel@oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/rds-devel
>
next prev parent reply other threads:[~2026-09-09 17:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 12:33 [PATCH net] rds: ib: use rds_conn_drop() on protocol version mismatch henrymei
2026-09-09 7:09 ` Allison Henderson
2026-09-09 17:25 ` Gerd Rausch [this message]
2026-09-09 22:55 ` [rds-devel] [External] : " Allison Henderson
2026-09-10 17:08 ` Gerd Rausch
2026-09-10 22:58 ` Allison Henderson
2026-09-10 23:56 ` Gerd Rausch
2026-09-11 8:19 ` Allison Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=10cf2701-211a-42fe-bb1b-c218d718ed2b@oracle.com \
--to=gerd.rausch@oracle.com \
--cc=achender@kernel.org \
--cc=corvus@tencent.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=henrymei@tencent.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=ljp1205831794@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rds-devel@oss.oracle.com \
--cc=santosh.shilimkar@oracle.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox