Skip to contentSkip to conversation

SUNRPC: fix a list corruption issue in xprt_release()

PATCH New Trond Myklebust 1 participant 1 message Oct 13, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SUNRPC: fix a list corruption issue in xprt_release()

We remove the request from the receive list before we call xprt_wait_on_pinned_rqst(), and so we need to use list_del_init(). Otherwise, we will see list corruption when xprt_complete_rqst() is called.

Fixes ce7c252a8c741 ("SUNRPC: Add a separate spinlock to protect...")
---
 net/sunrpc/xprt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/sunrpc/xprt.c +1 -1
index 5f12fe145f02..a61c99ff0a39 100644
@@ -1333,7 +1333,7 @@ void xprt_release(struct rpc_task *task)
 		rpc_count_iostats(task, task->tk_client->cl_metrics);
 	spin_lock(&xprt->recv_lock);
 	if (!list_empty(&req->rq_list)) {
-		list_del(&req->rq_list);
+		list_del_init(&req->rq_list);
 		xprt_wait_on_pinned_rqst(req);
 	}
 	spin_unlock(&xprt->recv_lock);
Signature · 1 line
2.13.6