aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svc_xprt.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2010-02-28 16:33:31 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2010-02-28 16:39:30 -0500
commit1b644b6e6f6160ae35ce4b52c2ca89ed3e356e18 (patch)
tree86e92799df5e98bed5293d2f4b9d75f58b2cea11 /net/sunrpc/svc_xprt.c
parentf5822754ea006563e1bf0a1f43faaad49c0d8bb2 (diff)
Revert "sunrpc: move the close processing after do recvfrom method"
This reverts commit b0401d725334a94d57335790b8ac2404144748ee, which moved svc_delete_xprt() outside of XPT_BUSY, and allowed it to be called after svc_xpt_recived(), removing its last reference and destroying it after it had already been queued for future processing. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'net/sunrpc/svc_xprt.c')
-rw-r--r--net/sunrpc/svc_xprt.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 818c4c365b28..8f0f1fb3dc52 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -706,7 +706,10 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
706 spin_unlock_bh(&pool->sp_lock); 706 spin_unlock_bh(&pool->sp_lock);
707 707
708 len = 0; 708 len = 0;
709 if (test_bit(XPT_LISTENER, &xprt->xpt_flags)) { 709 if (test_bit(XPT_CLOSE, &xprt->xpt_flags)) {
710 dprintk("svc_recv: found XPT_CLOSE\n");
711 svc_delete_xprt(xprt);
712 } else if (test_bit(XPT_LISTENER, &xprt->xpt_flags)) {
710 struct svc_xprt *newxpt; 713 struct svc_xprt *newxpt;
711 newxpt = xprt->xpt_ops->xpo_accept(xprt); 714 newxpt = xprt->xpt_ops->xpo_accept(xprt);
712 if (newxpt) { 715 if (newxpt) {
@@ -732,7 +735,7 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
732 svc_xprt_received(newxpt); 735 svc_xprt_received(newxpt);
733 } 736 }
734 svc_xprt_received(xprt); 737 svc_xprt_received(xprt);
735 } else if (!test_bit(XPT_CLOSE, &xprt->xpt_flags)) { 738 } else {
736 dprintk("svc: server %p, pool %u, transport %p, inuse=%d\n", 739 dprintk("svc: server %p, pool %u, transport %p, inuse=%d\n",
737 rqstp, pool->sp_id, xprt, 740 rqstp, pool->sp_id, xprt,
738 atomic_read(&xprt->xpt_ref.refcount)); 741 atomic_read(&xprt->xpt_ref.refcount));
@@ -745,11 +748,6 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
745 dprintk("svc: got len=%d\n", len); 748 dprintk("svc: got len=%d\n", len);
746 } 749 }
747 750
748 if (test_bit(XPT_CLOSE, &xprt->xpt_flags)) {
749 dprintk("svc_recv: found XPT_CLOSE\n");
750 svc_delete_xprt(xprt);
751 }
752
753 /* No data, incomplete (TCP) read, or accept() */ 751 /* No data, incomplete (TCP) read, or accept() */
754 if (len == 0 || len == -EAGAIN) { 752 if (len == 0 || len == -EAGAIN) {
755 rqstp->rq_res.len = 0; 753 rqstp->rq_res.len = 0;