Commit 8497ae61 authored by Linus Torvalds's avatar Linus Torvalds

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
parents a7e546f1 d10f27a7
...@@ -651,12 +651,12 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c ...@@ -651,12 +651,12 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c
if (clp->cl_minorversion == 0) { if (clp->cl_minorversion == 0) {
if (!clp->cl_cred.cr_principal && if (!clp->cl_cred.cr_principal &&
(clp->cl_flavor >= RPC_AUTH_GSS_KRB5)) (clp->cl_cred.cr_flavor >= RPC_AUTH_GSS_KRB5))
return -EINVAL; return -EINVAL;
args.client_name = clp->cl_cred.cr_principal; args.client_name = clp->cl_cred.cr_principal;
args.prognumber = conn->cb_prog, args.prognumber = conn->cb_prog,
args.protocol = XPRT_TRANSPORT_TCP; args.protocol = XPRT_TRANSPORT_TCP;
args.authflavor = clp->cl_flavor; args.authflavor = clp->cl_cred.cr_flavor;
clp->cl_cb_ident = conn->cb_ident; clp->cl_cb_ident = conn->cb_ident;
} else { } else {
if (!conn->cb_xprt) if (!conn->cb_xprt)
......
...@@ -231,7 +231,6 @@ struct nfs4_client { ...@@ -231,7 +231,6 @@ struct nfs4_client {
nfs4_verifier cl_verifier; /* generated by client */ nfs4_verifier cl_verifier; /* generated by client */
time_t cl_time; /* time of last lease renewal */ time_t cl_time; /* time of last lease renewal */
struct sockaddr_storage cl_addr; /* client ipaddress */ struct sockaddr_storage cl_addr; /* client ipaddress */
u32 cl_flavor; /* setclientid pseudoflavor */
struct svc_cred cl_cred; /* setclientid principal */ struct svc_cred cl_cred; /* setclientid principal */
clientid_t cl_clientid; /* generated by server */ clientid_t cl_clientid; /* generated by server */
nfs4_verifier cl_confirm; /* generated by server */ nfs4_verifier cl_confirm; /* generated by server */
......
...@@ -316,7 +316,6 @@ static bool svc_xprt_has_something_to_do(struct svc_xprt *xprt) ...@@ -316,7 +316,6 @@ static bool svc_xprt_has_something_to_do(struct svc_xprt *xprt)
*/ */
void svc_xprt_enqueue(struct svc_xprt *xprt) void svc_xprt_enqueue(struct svc_xprt *xprt)
{ {
struct svc_serv *serv = xprt->xpt_server;
struct svc_pool *pool; struct svc_pool *pool;
struct svc_rqst *rqstp; struct svc_rqst *rqstp;
int cpu; int cpu;
...@@ -362,8 +361,6 @@ void svc_xprt_enqueue(struct svc_xprt *xprt) ...@@ -362,8 +361,6 @@ void svc_xprt_enqueue(struct svc_xprt *xprt)
rqstp, rqstp->rq_xprt); rqstp, rqstp->rq_xprt);
rqstp->rq_xprt = xprt; rqstp->rq_xprt = xprt;
svc_xprt_get(xprt); svc_xprt_get(xprt);
rqstp->rq_reserved = serv->sv_max_mesg;
atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved);
pool->sp_stats.threads_woken++; pool->sp_stats.threads_woken++;
wake_up(&rqstp->rq_wait); wake_up(&rqstp->rq_wait);
} else { } else {
...@@ -640,8 +637,6 @@ int svc_recv(struct svc_rqst *rqstp, long timeout) ...@@ -640,8 +637,6 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
if (xprt) { if (xprt) {
rqstp->rq_xprt = xprt; rqstp->rq_xprt = xprt;
svc_xprt_get(xprt); svc_xprt_get(xprt);
rqstp->rq_reserved = serv->sv_max_mesg;
atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved);
/* As there is a shortage of threads and this request /* As there is a shortage of threads and this request
* had to be queued, don't allow the thread to wait so * 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,6 +733,8 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
else else
len = xprt->xpt_ops->xpo_recvfrom(rqstp); len = xprt->xpt_ops->xpo_recvfrom(rqstp);
dprintk("svc: got len=%d\n", len); dprintk("svc: got len=%d\n", len);
rqstp->rq_reserved = serv->sv_max_mesg;
atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved);
} }
svc_xprt_received(xprt); svc_xprt_received(xprt);
...@@ -794,7 +791,8 @@ int svc_send(struct svc_rqst *rqstp) ...@@ -794,7 +791,8 @@ int svc_send(struct svc_rqst *rqstp)
/* Grab mutex to serialize outgoing data. */ /* Grab mutex to serialize outgoing data. */
mutex_lock(&xprt->xpt_mutex); mutex_lock(&xprt->xpt_mutex);
if (test_bit(XPT_DEAD, &xprt->xpt_flags)) if (test_bit(XPT_DEAD, &xprt->xpt_flags)
|| test_bit(XPT_CLOSE, &xprt->xpt_flags))
len = -ENOTCONN; len = -ENOTCONN;
else else
len = xprt->xpt_ops->xpo_sendto(rqstp); len = xprt->xpt_ops->xpo_sendto(rqstp);
......
...@@ -1129,9 +1129,9 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp) ...@@ -1129,9 +1129,9 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp)
if (len >= 0) if (len >= 0)
svsk->sk_tcplen += len; svsk->sk_tcplen += len;
if (len != want) { if (len != want) {
svc_tcp_save_pages(svsk, rqstp);
if (len < 0 && len != -EAGAIN) if (len < 0 && len != -EAGAIN)
goto err_other; goto err_other;
svc_tcp_save_pages(svsk, rqstp);
dprintk("svc: incomplete TCP record (%d of %d)\n", dprintk("svc: incomplete TCP record (%d of %d)\n",
svsk->sk_tcplen, svsk->sk_reclen); svsk->sk_tcplen, svsk->sk_reclen);
goto err_noclose; goto err_noclose;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment