Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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()

+15 -14
+2 -11
fs/lockd/svcxdr.h
··· 134 134 static inline bool 135 135 svcxdr_encode_owner(struct xdr_stream *xdr, const struct xdr_netobj *obj) 136 136 { 137 - unsigned int quadlen = XDR_QUADLEN(obj->len); 138 - __be32 *p; 139 - 140 - if (xdr_stream_encode_u32(xdr, obj->len) < 0) 137 + if (obj->len > XDR_MAX_NETOBJ) 141 138 return false; 142 - p = xdr_reserve_space(xdr, obj->len); 143 - if (!p) 144 - return false; 145 - p[quadlen - 1] = 0; /* XDR pad */ 146 - memcpy(p, obj->data, obj->len); 147 - 148 - return true; 139 + return xdr_stream_encode_opaque(xdr, obj->data, obj->len) > 0; 149 140 } 150 141 151 142 #endif /* _LOCKD_SVCXDR_H_ */
+13 -3
fs/nfsd/nfs4state.c
··· 3570 3570 } 3571 3571 3572 3572 static __be32 nfsd4_match_existing_connection(struct svc_rqst *rqst, 3573 - struct nfsd4_session *session, u32 req) 3573 + struct nfsd4_session *session, u32 req, struct nfsd4_conn **conn) 3574 3574 { 3575 3575 struct nfs4_client *clp = session->se_client; 3576 3576 struct svc_xprt *xpt = rqst->rq_xprt; ··· 3593 3593 else 3594 3594 status = nfserr_inval; 3595 3595 spin_unlock(&clp->cl_lock); 3596 + if (status == nfs_ok && conn) 3597 + *conn = c; 3596 3598 return status; 3597 3599 } 3598 3600 ··· 3619 3617 status = nfserr_wrong_cred; 3620 3618 if (!nfsd4_mach_creds_match(session->se_client, rqstp)) 3621 3619 goto out; 3622 - status = nfsd4_match_existing_connection(rqstp, session, bcts->dir); 3623 - if (status == nfs_ok || status == nfserr_inval) 3620 + status = nfsd4_match_existing_connection(rqstp, session, 3621 + bcts->dir, &conn); 3622 + if (status == nfs_ok) { 3623 + if (bcts->dir == NFS4_CDFC4_FORE_OR_BOTH || 3624 + bcts->dir == NFS4_CDFC4_BACK) 3625 + conn->cn_flags |= NFS4_CDFC4_BACK; 3626 + nfsd4_probe_callback(session->se_client); 3627 + goto out; 3628 + } 3629 + if (status == nfserr_inval) 3624 3630 goto out; 3625 3631 status = nfsd4_map_bcts_dir(&bcts->dir); 3626 3632 if (status)