aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorWei Yongjun <yjwei@cn.fujitsu.com>2009-08-26 22:23:39 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-08-27 17:18:38 -0400
commitb0401d725334a94d57335790b8ac2404144748ee (patch)
tree38ab73b78e4d12c57198dac451e04e04a78efb55 /net/sunrpc
parentaaf84eb95a9c610c6413cee4836764ea9194eed3 (diff)
sunrpc: move the close processing after do recvfrom method
sunrpc: "Move close processing to a single place" (d7979ae4a050a45b78af51832475001b68263d2a) moved the close processing before the recvfrom method. This may cause the close processing never to execute. So this patch moves it to the right place. Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/svc_xprt.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index dcd2d1ee2e3c..912dea558ccc 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -710,10 +710,7 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
710 spin_unlock_bh(&pool->sp_lock); 710 spin_unlock_bh(&pool->sp_lock);
711 711
712 len = 0; 712 len = 0;
713 if (test_bit(XPT_CLOSE, &xprt->xpt_flags)) { 713 if (test_bit(XPT_LISTENER, &xprt->xpt_flags)) {
714 dprintk("svc_recv: found XPT_CLOSE\n");
715 svc_delete_xprt(xprt);
716 } else if (test_bit(XPT_LISTENER, &xprt->xpt_flags)) {
717 struct svc_xprt *newxpt; 714 struct svc_xprt *newxpt;
718 newxpt = xprt->xpt_ops->xpo_accept(xprt); 715 newxpt = xprt->xpt_ops->xpo_accept(xprt);
719 if (newxpt) { 716 if (newxpt) {
@@ -739,7 +736,7 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
739 svc_xprt_received(newxpt); 736 svc_xprt_received(newxpt);
740 } 737 }
741 svc_xprt_received(xprt); 738 svc_xprt_received(xprt);
742 } else { 739 } else if (!test_bit(XPT_CLOSE, &xprt->xpt_flags)) {
743 dprintk("svc: server %p, pool %u, transport %p, inuse=%d\n", 740 dprintk("svc: server %p, pool %u, transport %p, inuse=%d\n",
744 rqstp, pool->sp_id, xprt, 741 rqstp, pool->sp_id, xprt,
745 atomic_read(&xprt->xpt_ref.refcount)); 742 atomic_read(&xprt->xpt_ref.refcount));
@@ -752,6 +749,11 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
752 dprintk("svc: got len=%d\n", len); 749 dprintk("svc: got len=%d\n", len);
753 } 750 }
754 751
752 if (test_bit(XPT_CLOSE, &xprt->xpt_flags)) {
753 dprintk("svc_recv: found XPT_CLOSE\n");
754 svc_delete_xprt(xprt);
755 }
756
755 /* No data, incomplete (TCP) read, or accept() */ 757 /* No data, incomplete (TCP) read, or accept() */
756 if (len == 0 || len == -EAGAIN) { 758 if (len == 0 || len == -EAGAIN) {
757 rqstp->rq_res.len = 0; 759 rqstp->rq_res.len = 0;