diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-25 14:43:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-25 14:43:41 -0400 |
commit | 8497ae61d0e7f30ae9f20c5fcea94c957b6c3b83 (patch) | |
tree | 5056b18355891ebcc4d5cd6eee6e9e0915728749 /net | |
parent | a7e546f175f07630453c44b5afe14dd667dcfec9 (diff) | |
parent | d10f27a750312ed5638c876e4bd6aa83664cccd8 (diff) |
Merge branch 'for-3.6' of git://linux-nfs.org/~bfields/linux
Pull nfsd bugfixes from J. Bruce Fields:
"Particular thanks to Michael Tokarev, Malahal Naineni, and Jamie
Heilman for their testing and debugging help."
* 'for-3.6' of git://linux-nfs.org/~bfields/linux:
svcrpc: fix svc_xprt_enqueue/svc_recv busy-looping
svcrpc: sends on closed socket should stop immediately
svcrpc: fix BUG() in svc_tcp_clear_pages
nfsd4: fix security flavor of NFSv4.0 callback
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/svc_xprt.c | 10 | ||||
-rw-r--r-- | net/sunrpc/svcsock.c | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 88f2bf671960..bac973a31367 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -316,7 +316,6 @@ static bool svc_xprt_has_something_to_do(struct svc_xprt *xprt) | |||
316 | */ | 316 | */ |
317 | void svc_xprt_enqueue(struct svc_xprt *xprt) | 317 | void svc_xprt_enqueue(struct svc_xprt *xprt) |
318 | { | 318 | { |
319 | struct svc_serv *serv = xprt->xpt_server; | ||
320 | struct svc_pool *pool; | 319 | struct svc_pool *pool; |
321 | struct svc_rqst *rqstp; | 320 | struct svc_rqst *rqstp; |
322 | int cpu; | 321 | int cpu; |
@@ -362,8 +361,6 @@ void svc_xprt_enqueue(struct svc_xprt *xprt) | |||
362 | rqstp, rqstp->rq_xprt); | 361 | rqstp, rqstp->rq_xprt); |
363 | rqstp->rq_xprt = xprt; | 362 | rqstp->rq_xprt = xprt; |
364 | svc_xprt_get(xprt); | 363 | svc_xprt_get(xprt); |
365 | rqstp->rq_reserved = serv->sv_max_mesg; | ||
366 | atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved); | ||
367 | pool->sp_stats.threads_woken++; | 364 | pool->sp_stats.threads_woken++; |
368 | wake_up(&rqstp->rq_wait); | 365 | wake_up(&rqstp->rq_wait); |
369 | } else { | 366 | } else { |
@@ -640,8 +637,6 @@ int svc_recv(struct svc_rqst *rqstp, long timeout) | |||
640 | if (xprt) { | 637 | if (xprt) { |
641 | rqstp->rq_xprt = xprt; | 638 | rqstp->rq_xprt = xprt; |
642 | svc_xprt_get(xprt); | 639 | svc_xprt_get(xprt); |
643 | rqstp->rq_reserved = serv->sv_max_mesg; | ||
644 | atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved); | ||
645 | 640 | ||
646 | /* As there is a shortage of threads and this request | 641 | /* As there is a shortage of threads and this request |
647 | * had to be queued, don't allow the thread to wait so | 642 | * had to be queued, don't allow the thread to wait so |
@@ -738,6 +733,8 @@ int svc_recv(struct svc_rqst *rqstp, long timeout) | |||
738 | else | 733 | else |
739 | len = xprt->xpt_ops->xpo_recvfrom(rqstp); | 734 | len = xprt->xpt_ops->xpo_recvfrom(rqstp); |
740 | dprintk("svc: got len=%d\n", len); | 735 | dprintk("svc: got len=%d\n", len); |
736 | rqstp->rq_reserved = serv->sv_max_mesg; | ||
737 | atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved); | ||
741 | } | 738 | } |
742 | svc_xprt_received(xprt); | 739 | svc_xprt_received(xprt); |
743 | 740 | ||
@@ -794,7 +791,8 @@ int svc_send(struct svc_rqst *rqstp) | |||
794 | 791 | ||
795 | /* Grab mutex to serialize outgoing data. */ | 792 | /* Grab mutex to serialize outgoing data. */ |
796 | mutex_lock(&xprt->xpt_mutex); | 793 | mutex_lock(&xprt->xpt_mutex); |
797 | if (test_bit(XPT_DEAD, &xprt->xpt_flags)) | 794 | if (test_bit(XPT_DEAD, &xprt->xpt_flags) |
795 | || test_bit(XPT_CLOSE, &xprt->xpt_flags)) | ||
798 | len = -ENOTCONN; | 796 | len = -ENOTCONN; |
799 | else | 797 | else |
800 | len = xprt->xpt_ops->xpo_sendto(rqstp); | 798 | len = xprt->xpt_ops->xpo_sendto(rqstp); |
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 18bc130255a7..998aa8c1807c 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -1129,9 +1129,9 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp) | |||
1129 | if (len >= 0) | 1129 | if (len >= 0) |
1130 | svsk->sk_tcplen += len; | 1130 | svsk->sk_tcplen += len; |
1131 | if (len != want) { | 1131 | if (len != want) { |
1132 | svc_tcp_save_pages(svsk, rqstp); | ||
1132 | if (len < 0 && len != -EAGAIN) | 1133 | if (len < 0 && len != -EAGAIN) |
1133 | goto err_other; | 1134 | goto err_other; |
1134 | svc_tcp_save_pages(svsk, rqstp); | ||
1135 | dprintk("svc: incomplete TCP record (%d of %d)\n", | 1135 | dprintk("svc: incomplete TCP record (%d of %d)\n", |
1136 | svsk->sk_tcplen, svsk->sk_reclen); | 1136 | svsk->sk_tcplen, svsk->sk_reclen); |
1137 | goto err_noclose; | 1137 | goto err_noclose; |