Skip to content

Commit

Permalink
SUNRPC: Ensure we always bump the backlog queue in xprt_free_slot
Browse files Browse the repository at this point in the history
Whenever we free a slot, we know that the resulting xprt->num_reqs will
be less than xprt->max_reqs, so we know that we can release at least one
backlogged rpc_task.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@vger.kernel.org [>=3.1]
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Dec 1, 2011
1 parent 7fdcf13 commit c25573b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions net/sunrpc/xprt.c
Original file line number Diff line number Diff line change
Expand Up @@ -995,13 +995,11 @@ static void xprt_alloc_slot(struct rpc_task *task)

static void xprt_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *req)
{
if (xprt_dynamic_free_slot(xprt, req))
return;

memset(req, 0, sizeof(*req)); /* mark unused */

spin_lock(&xprt->reserve_lock);
list_add(&req->rq_list, &xprt->free);
if (!xprt_dynamic_free_slot(xprt, req)) {
memset(req, 0, sizeof(*req)); /* mark unused */
list_add(&req->rq_list, &xprt->free);
}
rpc_wake_up_next(&xprt->backlog);
spin_unlock(&xprt->reserve_lock);
}
Expand Down

0 comments on commit c25573b

Please sign in to comment.