merge nfs bugfixes into nfsd for-3.19 branch
In addition to nfsd bugfixes, there are some fixes in -rc5 for client bugs that can interfere with my testing.
This commit is contained in:
@@ -1353,6 +1353,7 @@ gss_stringify_acceptor(struct rpc_cred *cred)
|
||||
char *string = NULL;
|
||||
struct gss_cred *gss_cred = container_of(cred, struct gss_cred, gc_base);
|
||||
struct gss_cl_ctx *ctx;
|
||||
unsigned int len;
|
||||
struct xdr_netobj *acceptor;
|
||||
|
||||
rcu_read_lock();
|
||||
@@ -1360,15 +1361,39 @@ gss_stringify_acceptor(struct rpc_cred *cred)
|
||||
if (!ctx)
|
||||
goto out;
|
||||
|
||||
acceptor = &ctx->gc_acceptor;
|
||||
len = ctx->gc_acceptor.len;
|
||||
rcu_read_unlock();
|
||||
|
||||
/* no point if there's no string */
|
||||
if (!acceptor->len)
|
||||
goto out;
|
||||
|
||||
string = kmalloc(acceptor->len + 1, GFP_KERNEL);
|
||||
if (!len)
|
||||
return NULL;
|
||||
realloc:
|
||||
string = kmalloc(len + 1, GFP_KERNEL);
|
||||
if (!string)
|
||||
return NULL;
|
||||
|
||||
rcu_read_lock();
|
||||
ctx = rcu_dereference(gss_cred->gc_ctx);
|
||||
|
||||
/* did the ctx disappear or was it replaced by one with no acceptor? */
|
||||
if (!ctx || !ctx->gc_acceptor.len) {
|
||||
kfree(string);
|
||||
string = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
acceptor = &ctx->gc_acceptor;
|
||||
|
||||
/*
|
||||
* Did we find a new acceptor that's longer than the original? Allocate
|
||||
* a longer buffer and try again.
|
||||
*/
|
||||
if (len < acceptor->len) {
|
||||
len = acceptor->len;
|
||||
rcu_read_unlock();
|
||||
kfree(string);
|
||||
goto realloc;
|
||||
}
|
||||
|
||||
memcpy(string, acceptor->data, acceptor->len);
|
||||
string[acceptor->len] = '\0';
|
||||
|
@@ -1019,17 +1019,12 @@ static int receive_cb_reply(struct svc_sock *svsk, struct svc_rqst *rqstp)
|
||||
xid = *p++;
|
||||
calldir = *p;
|
||||
|
||||
if (bc_xprt)
|
||||
req = xprt_lookup_rqst(bc_xprt, xid);
|
||||
|
||||
if (!req) {
|
||||
printk(KERN_NOTICE
|
||||
"%s: Got unrecognized reply: "
|
||||
"calldir 0x%x xpt_bc_xprt %p xid %08x\n",
|
||||
__func__, ntohl(calldir),
|
||||
bc_xprt, ntohl(xid));
|
||||
if (!bc_xprt)
|
||||
return -EAGAIN;
|
||||
}
|
||||
spin_lock_bh(&bc_xprt->transport_lock);
|
||||
req = xprt_lookup_rqst(bc_xprt, xid);
|
||||
if (!req)
|
||||
goto unlock_notfound;
|
||||
|
||||
memcpy(&req->rq_private_buf, &req->rq_rcv_buf, sizeof(struct xdr_buf));
|
||||
/*
|
||||
@@ -1040,11 +1035,21 @@ static int receive_cb_reply(struct svc_sock *svsk, struct svc_rqst *rqstp)
|
||||
dst = &req->rq_private_buf.head[0];
|
||||
src = &rqstp->rq_arg.head[0];
|
||||
if (dst->iov_len < src->iov_len)
|
||||
return -EAGAIN; /* whatever; just giving up. */
|
||||
goto unlock_eagain; /* whatever; just giving up. */
|
||||
memcpy(dst->iov_base, src->iov_base, src->iov_len);
|
||||
xprt_complete_rqst(req->rq_task, rqstp->rq_arg.len);
|
||||
rqstp->rq_arg.len = 0;
|
||||
spin_unlock_bh(&bc_xprt->transport_lock);
|
||||
return 0;
|
||||
unlock_notfound:
|
||||
printk(KERN_NOTICE
|
||||
"%s: Got unrecognized reply: "
|
||||
"calldir 0x%x xpt_bc_xprt %p xid %08x\n",
|
||||
__func__, ntohl(calldir),
|
||||
bc_xprt, ntohl(xid));
|
||||
unlock_eagain:
|
||||
spin_unlock_bh(&bc_xprt->transport_lock);
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
static int copy_pages_to_kvecs(struct kvec *vec, struct page **pages, int len)
|
||||
|
Reference in New Issue
Block a user