Skip to content

Commit

Permalink
svcrpc: don't hold sv_lock over svc_xprt_put()
Browse files Browse the repository at this point in the history
svc_xprt_put() can call tcp_close(), which can sleep, so we shouldn't be
holding this lock.

In fact, only the xpt_list removal and the sv_tmpcnt decrement should
need the sv_lock here.

Reported-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
  • Loading branch information
J. Bruce Fields committed Mar 30, 2010
1 parent a5990ea commit 788e69e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sunrpc/svc_xprt.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,12 +892,12 @@ void svc_delete_xprt(struct svc_xprt *xprt)
*/
if (test_bit(XPT_TEMP, &xprt->xpt_flags))
serv->sv_tmpcnt--;
spin_unlock_bh(&serv->sv_lock);

while ((dr = svc_deferred_dequeue(xprt)) != NULL)
kfree(dr);

svc_xprt_put(xprt);
spin_unlock_bh(&serv->sv_lock);
}

void svc_close_xprt(struct svc_xprt *xprt)
Expand Down

0 comments on commit 788e69e

Please sign in to comment.