diff options
author | Neil Brown <neilb@suse.de> | 2010-02-26 17:33:40 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-15 12:07:01 -0400 |
commit | f774f57a79ba1515eda139023cdc00b7209ab96b (patch) | |
tree | b6742aaccb2cc4d97d4d5d21d69c4f406a928e83 /net | |
parent | 293ad927682715d8f2bbe8350821b2b0d244f7eb (diff) |
sunrpc: remove unnecessary svc_xprt_put
commit ab1b18f70a007ea6caeb007d269abb75b131a410 upstream.
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>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/svc_xprt.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 7d1f9e928f69..4f303360b565 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -889,11 +889,8 @@ void svc_delete_xprt(struct svc_xprt *xprt) | |||
889 | if (test_bit(XPT_TEMP, &xprt->xpt_flags)) | 889 | if (test_bit(XPT_TEMP, &xprt->xpt_flags)) |
890 | serv->sv_tmpcnt--; | 890 | serv->sv_tmpcnt--; |
891 | 891 | ||
892 | for (dr = svc_deferred_dequeue(xprt); dr; | 892 | while ((dr = svc_deferred_dequeue(xprt)) != NULL) |
893 | dr = svc_deferred_dequeue(xprt)) { | ||
894 | svc_xprt_put(xprt); | ||
895 | kfree(dr); | 893 | kfree(dr); |
896 | } | ||
897 | 894 | ||
898 | svc_xprt_put(xprt); | 895 | svc_xprt_put(xprt); |
899 | spin_unlock_bh(&serv->sv_lock); | 896 | spin_unlock_bh(&serv->sv_lock); |