Skip to content

Commit

Permalink
sunrpc: remove unnecessary svc_xprt_put
Browse files Browse the repository at this point in the history
The 'struct svc_deferred_req's on the xpt_deferred queue do not
own a reference to the owning xprt.  This is seen in svc_revisit
which is where things are added to this queue.  dr->xprt is set to
NULL and the reference to the xprt it put.

So when this list is cleaned up in svc_delete_xprt, we mustn't
put the reference.

Also, replace the 'for' with a 'while' which is arguably
simpler and more likely to compile efficiently.

Cc: Tom Tucker <tom@opengridcomputing.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Cc: stable@kernel.org
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
  • Loading branch information
Neil Brown authored and J. Bruce Fields committed Feb 26, 2010
1 parent 58255a4 commit ab1b18f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions net/sunrpc/svc_xprt.c
Original file line number Diff line number Diff line change
Expand Up @@ -896,11 +896,8 @@ void svc_delete_xprt(struct svc_xprt *xprt)
if (test_bit(XPT_TEMP, &xprt->xpt_flags))
serv->sv_tmpcnt--;

for (dr = svc_deferred_dequeue(xprt); dr;
dr = svc_deferred_dequeue(xprt)) {
svc_xprt_put(xprt);
while ((dr = svc_deferred_dequeue(xprt)) != NULL)
kfree(dr);
}

svc_xprt_put(xprt);
spin_unlock_bh(&serv->sv_lock);
Expand Down

0 comments on commit ab1b18f

Please sign in to comment.