From: liangzhen Date: Thu, 16 Feb 2006 03:43:24 +0000 (+0000) Subject: spinlock should be released while calling non-atomic OBD_ALLOC() & OBD_ALLOC_GFP() X-Git-Tag: v1_7_140~1^12~3^2~39 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=f0bf3be49a2d0b2abc25e9c2f8f6cca4f27f1588;p=fs%2Flustre-release.git spinlock should be released while calling non-atomic OBD_ALLOC() & OBD_ALLOC_GFP() --- diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index fa233e0..eb45b24 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -224,19 +224,21 @@ void ptlrpc_add_rqs_to_pool(struct ptlrpc_request_pool *pool, int num_rq) for (i = 0; i < num_rq; i++) { struct ptlrpc_request *req; struct lustre_msg *msg; + + spin_unlock(&pool->prp_lock); OBD_ALLOC(req, sizeof(struct ptlrpc_request)); if (!req) - goto out; + return; OBD_ALLOC_GFP(msg, size, CFS_ALLOC_STD); if (!msg) { OBD_FREE(req, sizeof(struct ptlrpc_request)); - goto out; + return; } req->rq_reqmsg = msg; req->rq_pool = pool; + spin_lock(&pool->prp_lock); list_add_tail(&req->rq_list, &pool->prp_req_list); } -out: spin_unlock(&pool->prp_lock); return; }