nfsd: back channel stuck in SEQ4_STATUS_CB_PATH_DOWN
[sfrench/cifs-2.6.git] / fs / nfsd / nfs4state.c
index 4b6d60b46b0ace468a6621bfcdbf68faeffc0dbe..ba8bab17175ecdf04b0a24fc84772dd30180a916 100644 (file)
@@ -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,
-                               struct nfsd4_session *session, u32 req)
+               struct nfsd4_session *session, u32 req, struct nfsd4_conn **conn)
 {
        struct nfs4_client *clp = session->se_client;
        struct svc_xprt *xpt = rqst->rq_xprt;
@@ -3593,6 +3593,8 @@ static __be32 nfsd4_match_existing_connection(struct svc_rqst *rqst,
        else
                status = nfserr_inval;
        spin_unlock(&clp->cl_lock);
+       if (status == nfs_ok && conn)
+               *conn = c;
        return status;
 }
 
@@ -3617,8 +3619,16 @@ __be32 nfsd4_bind_conn_to_session(struct svc_rqst *rqstp,
        status = nfserr_wrong_cred;
        if (!nfsd4_mach_creds_match(session->se_client, rqstp))
                goto out;
-       status = nfsd4_match_existing_connection(rqstp, session, bcts->dir);
-       if (status == nfs_ok || status == nfserr_inval)
+       status = nfsd4_match_existing_connection(rqstp, session,
+                       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;
        status = nfsd4_map_bcts_dir(&bcts->dir);
        if (status)