Skip to content

Commit c25573b

Browse files
Trond MyklebustTrond Myklebust
Trond Myklebust
authored and
Trond Myklebust
committed
SUNRPC: Ensure we always bump the backlog queue in xprt_free_slot
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 <[email protected]> Cc: [email protected] [>=3.1]
1 parent 7fdcf13 commit c25573b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

net/sunrpc/xprt.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -995,13 +995,11 @@ static void xprt_alloc_slot(struct rpc_task *task)
995995

996996
static void xprt_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *req)
997997
{
998-
if (xprt_dynamic_free_slot(xprt, req))
999-
return;
1000-
1001-
memset(req, 0, sizeof(*req)); /* mark unused */
1002-
1003998
spin_lock(&xprt->reserve_lock);
1004-
list_add(&req->rq_list, &xprt->free);
999+
if (!xprt_dynamic_free_slot(xprt, req)) {
1000+
memset(req, 0, sizeof(*req)); /* mark unused */
1001+
list_add(&req->rq_list, &xprt->free);
1002+
}
10051003
rpc_wake_up_next(&xprt->backlog);
10061004
spin_unlock(&xprt->reserve_lock);
10071005
}

0 commit comments

Comments
 (0)