Skip to contentSkip to conversation

SVCRDMA: Add check for XPT_CLOSE in svc_rdma_send

PATCH In review Tom Tucker 2 participants 3 messages Mar 11, 2008 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

Tom Tucker

author
#0 lore raw

PATCH 1/1 SVCRDMA: Add check for XPT_CLOSE in svc_rdma_send

SVCRDMA: Add check for XPT_CLOSE in svc_rdma_send

The svcrdma transport can crash if a send is waiting for an empty SQ slot and the connection is closed due to an asynchronous error. The crash is caused when svc_rdma_send attempts to send on a deleted QP.

---

This is not a critical fix for 2.6.25, but part of a general clean up of the error paths.

 net/sunrpc/xprtrdma/svc_rdma_transport.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
net/sunrpc/xprtrdma/svc_rdma_transport.c +2 -0
index 16fd3f6..af408fc 100644
@@ -1036,6 +1036,8 @@ int svc_rdma_send(struct svcxprt_rdma *xprt, struct ib_send_wr *wr)
 			wait_event(xprt->sc_send_wait,
 				   atomic_read(&xprt->sc_sq_count) <
 				   xprt->sc_sq_depth);
+			if (test_bit(XPT_CLOSE, &xprt->sc_xprt.xpt_flags))
+				return 0;
 			continue;
 		}
 		/* Bumped used SQ WR count and post */

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 11 lines · Tom Tucker

SVCRDMA: Add check for XPT_CLOSE in svc_rdma_send

The svcrdma transport can crash if a send is waiting for an empty SQ slot and the connection is closed due to an asynchronous error. The crash is caused when svc_rdma_send attempts to send on a deleted QP.

---

This is not a critical fix for 2.6.25, but part of a general clean up of the error paths.

OK, thanks; I've applied this, and passed along the other two to Linus.

--b.

author
#3 lore raw
Quoted 8 lines · J. Bruce Fields
Quoted 7 lines · Tom Tucker

SVCRDMA: Add check for XPT_CLOSE in svc_rdma_send

The svcrdma transport can crash if a send is waiting for an empty SQ slot and the connection is closed due to an asynchronous error. The crash is caused when svc_rdma_send attempts to send on a deleted QP.

Quoted 6 lines
Quoted 4 lines

---

This is not a critical fix for 2.6.25, but part of a general clean up of the error paths.

OK, thanks; I've applied this, and passed along the other two to Linus.

Awesome, thanks.

Quoted 2 lines

--b.