Commit 83aaf3b3 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-3.11' of git://linux-nfs.org/~bfields/linux

Pull nfsd bugfixes from Bruce Fields:
 "Most of this is due to a screwup on my part -- some gss-proxy crashes
  got fixed before the merge window but somehow never made it out of a
  temporary git repo on my laptop...."

* 'for-3.11' of git://linux-nfs.org/~bfields/linux:
  svcrpc: set cr_gss_mech from gss-proxy as well as legacy upcall
  svcrpc: fix kfree oops in gss-proxy code
  svcrpc: fix gss-proxy xdr decoding oops
  svcrpc: fix gss_rpc_upcall create error
  NFSD/sunrpc: avoid deadlock on TCP connection due to memory pressure.
parents 32c6e258 7193bd17
...@@ -120,7 +120,7 @@ static int gssp_rpc_create(struct net *net, struct rpc_clnt **_clnt) ...@@ -120,7 +120,7 @@ static int gssp_rpc_create(struct net *net, struct rpc_clnt **_clnt)
if (IS_ERR(clnt)) { if (IS_ERR(clnt)) {
dprintk("RPC: failed to create AF_LOCAL gssproxy " dprintk("RPC: failed to create AF_LOCAL gssproxy "
"client (errno %ld).\n", PTR_ERR(clnt)); "client (errno %ld).\n", PTR_ERR(clnt));
result = -PTR_ERR(clnt); result = PTR_ERR(clnt);
*_clnt = NULL; *_clnt = NULL;
goto out; goto out;
} }
...@@ -328,7 +328,6 @@ void gssp_free_upcall_data(struct gssp_upcall_data *data) ...@@ -328,7 +328,6 @@ void gssp_free_upcall_data(struct gssp_upcall_data *data)
kfree(data->in_handle.data); kfree(data->in_handle.data);
kfree(data->out_handle.data); kfree(data->out_handle.data);
kfree(data->out_token.data); kfree(data->out_token.data);
kfree(data->mech_oid.data);
free_svc_cred(&data->creds); free_svc_cred(&data->creds);
} }
......
...@@ -430,7 +430,7 @@ static int dummy_enc_nameattr_array(struct xdr_stream *xdr, ...@@ -430,7 +430,7 @@ static int dummy_enc_nameattr_array(struct xdr_stream *xdr,
static int dummy_dec_nameattr_array(struct xdr_stream *xdr, static int dummy_dec_nameattr_array(struct xdr_stream *xdr,
struct gssx_name_attr_array *naa) struct gssx_name_attr_array *naa)
{ {
struct gssx_name_attr dummy; struct gssx_name_attr dummy = { .attr = {.len = 0} };
u32 count, i; u32 count, i;
__be32 *p; __be32 *p;
...@@ -493,12 +493,13 @@ static int gssx_enc_name(struct xdr_stream *xdr, ...@@ -493,12 +493,13 @@ static int gssx_enc_name(struct xdr_stream *xdr,
return err; return err;
} }
static int gssx_dec_name(struct xdr_stream *xdr, static int gssx_dec_name(struct xdr_stream *xdr,
struct gssx_name *name) struct gssx_name *name)
{ {
struct xdr_netobj dummy_netobj; struct xdr_netobj dummy_netobj = { .len = 0 };
struct gssx_name_attr_array dummy_name_attr_array; struct gssx_name_attr_array dummy_name_attr_array = { .count = 0 };
struct gssx_option_array dummy_option_array; struct gssx_option_array dummy_option_array = { .count = 0 };
int err; int err;
/* name->display_name */ /* name->display_name */
......
...@@ -1180,6 +1180,7 @@ static int gss_proxy_save_rsc(struct cache_detail *cd, ...@@ -1180,6 +1180,7 @@ static int gss_proxy_save_rsc(struct cache_detail *cd,
gm = gss_mech_get_by_OID(&ud->mech_oid); gm = gss_mech_get_by_OID(&ud->mech_oid);
if (!gm) if (!gm)
goto out; goto out;
rsci.cred.cr_gss_mech = gm;
status = -EINVAL; status = -EINVAL;
/* mech-specific data: */ /* mech-specific data: */
...@@ -1195,7 +1196,6 @@ static int gss_proxy_save_rsc(struct cache_detail *cd, ...@@ -1195,7 +1196,6 @@ static int gss_proxy_save_rsc(struct cache_detail *cd,
rscp = rsc_update(cd, &rsci, rscp); rscp = rsc_update(cd, &rsci, rscp);
status = 0; status = 0;
out: out:
gss_mech_put(gm);
rsc_free(&rsci); rsc_free(&rsci);
if (rscp) if (rscp)
cache_put(&rscp->h, cd); cache_put(&rscp->h, cd);
......
...@@ -1193,7 +1193,9 @@ static int svc_tcp_has_wspace(struct svc_xprt *xprt) ...@@ -1193,7 +1193,9 @@ static int svc_tcp_has_wspace(struct svc_xprt *xprt)
if (test_bit(XPT_LISTENER, &xprt->xpt_flags)) if (test_bit(XPT_LISTENER, &xprt->xpt_flags))
return 1; return 1;
required = atomic_read(&xprt->xpt_reserved) + serv->sv_max_mesg; required = atomic_read(&xprt->xpt_reserved) + serv->sv_max_mesg;
if (sk_stream_wspace(svsk->sk_sk) >= required) if (sk_stream_wspace(svsk->sk_sk) >= required ||
(sk_stream_min_wspace(svsk->sk_sk) == 0 &&
atomic_read(&xprt->xpt_reserved) == 0))
return 1; return 1;
set_bit(SOCK_NOSPACE, &svsk->sk_sock->flags); set_bit(SOCK_NOSPACE, &svsk->sk_sock->flags);
return 0; return 0;
......
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