From 5974a26cef6204bb356cbf55d4daba8163d2f198 Mon Sep 17 00:00:00 2001 From: yury Date: Fri, 7 Nov 2008 12:31:50 +0000 Subject: [PATCH] b=17445 r=tappro,johann - adds proper locking during freeing rq pool and its requests --- lustre/ptlrpc/client.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index 8b76d67..00bd237 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -419,16 +419,17 @@ void ptlrpc_free_rq_pool(struct ptlrpc_request_pool *pool) struct list_head *l, *tmp; struct ptlrpc_request *req; - if (!pool) - return; + LASSERT(pool != NULL); + spin_lock(&pool->prp_lock); list_for_each_safe(l, tmp, &pool->prp_req_list) { req = list_entry(l, struct ptlrpc_request, rq_list); list_del(&req->rq_list); - LASSERT (req->rq_reqmsg); + LASSERT(req->rq_reqmsg); OBD_FREE(req->rq_reqmsg, pool->prp_rq_size); OBD_FREE(req, sizeof(*req)); } + spin_unlock(&pool->prp_lock); OBD_FREE(pool, sizeof(*pool)); } -- 1.8.3.1