Linux NFS development
 help / color / mirror / Atom feed
From: Dan Aloni <dan.aloni@vastdata.com>
To: chuck.lever@oracle.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 1/2] rpcrdma: fix handling for RDMA_CM_EVENT_DISCONNECTED due to address change
Date: Thu, 11 Jul 2024 12:59:07 +0300	[thread overview]
Message-ID: <20240711095908.1604235-1-dan.aloni@vastdata.com> (raw)

We observed a scenario in IB bonding where RDMA_CM_EVENT_ADDR_CHANGE is
followed by RDMA_CM_EVENT_DISCONNECTED on a connected endpoint. This
sequence causes a negative reference splat and subsequent tear-down
issues due to a duplication in the disconnection path.

This fix aligns with the approach taken in a previous change
4836da219781 ("rpcrdma: fix handling for RDMA_CM_EVENT_DEVICE_REMOVAL"),
addressing a similar issue.

Signed-off-by: Dan Aloni <dan.aloni@vastdata.com>
---
 net/sunrpc/xprtrdma/verbs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index 432557a553e7..e42f5664ecaf 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -273,7 +273,8 @@ rpcrdma_cm_event_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
 		wake_up_all(&ep->re_connect_wait);
 		return 0;
 	case RDMA_CM_EVENT_DISCONNECTED:
-		ep->re_connect_status = -ECONNABORTED;
+		if (xchg(&ep->re_connect_status, -ECONNABORTED) != 1)
+			break;
 disconnected:
 		rpcrdma_force_disconnect(ep);
 		return rpcrdma_ep_put(ep);
-- 
2.39.3


             reply	other threads:[~2024-07-11  9:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-11  9:59 Dan Aloni [this message]
2024-07-11  9:59 ` [PATCH 2/2] rpcrdma: improve handling of RDMA_CM_EVENT_ADDR_CHANGE Dan Aloni
2024-07-11 10:11   ` Sagi Grimberg
2024-07-11 12:26     ` Dan Aloni
2024-07-11 12:34       ` Sagi Grimberg
2024-07-11 13:31     ` Chuck Lever III
2024-07-11 10:08 ` [PATCH 1/2] rpcrdma: fix handling for RDMA_CM_EVENT_DISCONNECTED due to address change Sagi Grimberg

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=20240711095908.1604235-1-dan.aloni@vastdata.com \
    --to=dan.aloni@vastdata.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@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