Skip to contentSkip to conversation

svcrdma: Initialize the context free list for listeners

PATCH In review Tom Tucker 2 participants 2 messages May 23, 2008 – May 25, 2008 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

Tom Tucker

author
#0 lore raw

PATCH 1/1 svcrdma: Initialize the context free list for listeners

Move the initialization of the sc_ctxt_free list to the client/listener generic bit of the init logic. This is necessary to avoid a bug check when shutting down a listening endpoint when list debug is enabled. This bug was introduced when the context cache was converted to use Linux lists.

---
 net/sunrpc/xprtrdma/svc_rdma_transport.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/sunrpc/xprtrdma/svc_rdma_transport.c +1 -1
index 54b2126..2c2f5f6 100644
@@ -446,7 +446,6 @@ static void create_context_cache(struct svcxprt_rdma *xprt,
 	xprt->sc_ctxt_cnt = 0;
 	atomic_set(&xprt->sc_ctxt_used, 0);
 
-	INIT_LIST_HEAD(&xprt->sc_ctxt_free);
 	for (i = 0; i < ctxt_count; i++) {
 		ctxt = kmalloc(sizeof(*ctxt), GFP_KERNEL);
 		if (ctxt) {
@@ -496,6 +495,7 @@ static struct svcxprt_rdma *rdma_create_xprt(struct svc_serv *serv,
 	atomic_set(&cma_xprt->sc_sq_count, 0);
 	atomic_set(&cma_xprt->sc_ctxt_used, 0);
 
+	INIT_LIST_HEAD(&cma_xprt->sc_ctxt_free);
 	if (!listener) {
 		int reqs = cma_xprt->sc_max_requests;
 		create_context_cache(cma_xprt,

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

#2 lore raw
Quoted 5 lines · Tom Tucker

Move the initialization of the sc_ctxt_free list to the client/listener generic bit of the init logic. This is necessary to avoid a bug check when shutting down a listening endpoint when list debug is enabled. This bug was introduced when the context cache was converted to use Linux lists.

OK.--b.

Quoted 27 lines
---
 net/sunrpc/xprtrdma/svc_rdma_transport.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/sunrpc/xprtrdma/svc_rdma_transport.c +1 -1
index 54b2126..2c2f5f6 100644
@@ -446,7 +446,6 @@ static void create_context_cache(struct svcxprt_rdma *xprt,
 	xprt->sc_ctxt_cnt = 0;
 	atomic_set(&xprt->sc_ctxt_used, 0);
 
-	INIT_LIST_HEAD(&xprt->sc_ctxt_free);
 	for (i = 0; i < ctxt_count; i++) {
 		ctxt = kmalloc(sizeof(*ctxt), GFP_KERNEL);
 		if (ctxt) {
@@ -496,6 +495,7 @@ static struct svcxprt_rdma *rdma_create_xprt(struct svc_serv *serv,
 	atomic_set(&cma_xprt->sc_sq_count, 0);
 	atomic_set(&cma_xprt->sc_ctxt_used, 0);
 
+	INIT_LIST_HEAD(&cma_xprt->sc_ctxt_free);
 	if (!listener) {
 		int reqs = cma_xprt->sc_max_requests;
 		create_context_cache(cma_xprt,