Commit cf1d2c3e authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'nfsd-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux

Pull nfsd fixes from Chuck Lever:
 "Critical bug fixes:

   - Fix crash in NLM TEST procedure

   - NFSv4.1+ backchannel not restored after PATH_DOWN"

* tag 'nfsd-5.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
  nfsd: back channel stuck in SEQ4_STATUS_CB_PATH_DOWN
  NLM: Fix svcxdr_encode_owner()
parents bee42512 02579b2f
...@@ -134,18 +134,9 @@ svcxdr_decode_owner(struct xdr_stream *xdr, struct xdr_netobj *obj) ...@@ -134,18 +134,9 @@ svcxdr_decode_owner(struct xdr_stream *xdr, struct xdr_netobj *obj)
static inline bool static inline bool
svcxdr_encode_owner(struct xdr_stream *xdr, const struct xdr_netobj *obj) svcxdr_encode_owner(struct xdr_stream *xdr, const struct xdr_netobj *obj)
{ {
unsigned int quadlen = XDR_QUADLEN(obj->len); if (obj->len > XDR_MAX_NETOBJ)
__be32 *p;
if (xdr_stream_encode_u32(xdr, obj->len) < 0)
return false;
p = xdr_reserve_space(xdr, obj->len);
if (!p)
return false; return false;
p[quadlen - 1] = 0; /* XDR pad */ return xdr_stream_encode_opaque(xdr, obj->data, obj->len) > 0;
memcpy(p, obj->data, obj->len);
return true;
} }
#endif /* _LOCKD_SVCXDR_H_ */ #endif /* _LOCKD_SVCXDR_H_ */
...@@ -3570,7 +3570,7 @@ static struct nfsd4_conn *__nfsd4_find_conn(struct svc_xprt *xpt, struct nfsd4_s ...@@ -3570,7 +3570,7 @@ static struct nfsd4_conn *__nfsd4_find_conn(struct svc_xprt *xpt, struct nfsd4_s
} }
static __be32 nfsd4_match_existing_connection(struct svc_rqst *rqst, static __be32 nfsd4_match_existing_connection(struct svc_rqst *rqst,
struct nfsd4_session *session, u32 req) struct nfsd4_session *session, u32 req, struct nfsd4_conn **conn)
{ {
struct nfs4_client *clp = session->se_client; struct nfs4_client *clp = session->se_client;
struct svc_xprt *xpt = rqst->rq_xprt; struct svc_xprt *xpt = rqst->rq_xprt;
...@@ -3593,6 +3593,8 @@ static __be32 nfsd4_match_existing_connection(struct svc_rqst *rqst, ...@@ -3593,6 +3593,8 @@ static __be32 nfsd4_match_existing_connection(struct svc_rqst *rqst,
else else
status = nfserr_inval; status = nfserr_inval;
spin_unlock(&clp->cl_lock); spin_unlock(&clp->cl_lock);
if (status == nfs_ok && conn)
*conn = c;
return status; return status;
} }
...@@ -3617,8 +3619,16 @@ __be32 nfsd4_bind_conn_to_session(struct svc_rqst *rqstp, ...@@ -3617,8 +3619,16 @@ __be32 nfsd4_bind_conn_to_session(struct svc_rqst *rqstp,
status = nfserr_wrong_cred; status = nfserr_wrong_cred;
if (!nfsd4_mach_creds_match(session->se_client, rqstp)) if (!nfsd4_mach_creds_match(session->se_client, rqstp))
goto out; goto out;
status = nfsd4_match_existing_connection(rqstp, session, bcts->dir); status = nfsd4_match_existing_connection(rqstp, session,
if (status == nfs_ok || status == nfserr_inval) bcts->dir, &conn);
if (status == nfs_ok) {
if (bcts->dir == NFS4_CDFC4_FORE_OR_BOTH ||
bcts->dir == NFS4_CDFC4_BACK)
conn->cn_flags |= NFS4_CDFC4_BACK;
nfsd4_probe_callback(session->se_client);
goto out;
}
if (status == nfserr_inval)
goto out; goto out;
status = nfsd4_map_bcts_dir(&bcts->dir); status = nfsd4_map_bcts_dir(&bcts->dir);
if (status) if (status)
......
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