Skip to content

Commit 02579b2

Browse files
daimngochucklever
authored andcommitted
nfsd: back channel stuck in SEQ4_STATUS_CB_PATH_DOWN
When the back channel enters SEQ4_STATUS_CB_PATH_DOWN state, the client recovers by sending BIND_CONN_TO_SESSION but the server fails to recover the back channel and leaves it as NFSD4_CB_DOWN. Fix by enhancing nfsd4_bind_conn_to_session to probe the back channel by calling nfsd4_probe_callback. Signed-off-by: Dai Ngo <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 89c485c commit 02579b2

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

fs/nfsd/nfs4state.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3570,7 +3570,7 @@ static struct nfsd4_conn *__nfsd4_find_conn(struct svc_xprt *xpt, struct nfsd4_s
35703570
}
35713571

35723572
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)
35743574
{
35753575
struct nfs4_client *clp = session->se_client;
35763576
struct svc_xprt *xpt = rqst->rq_xprt;
@@ -3593,6 +3593,8 @@ static __be32 nfsd4_match_existing_connection(struct svc_rqst *rqst,
35933593
else
35943594
status = nfserr_inval;
35953595
spin_unlock(&clp->cl_lock);
3596+
if (status == nfs_ok && conn)
3597+
*conn = c;
35963598
return status;
35973599
}
35983600

@@ -3617,8 +3619,16 @@ __be32 nfsd4_bind_conn_to_session(struct svc_rqst *rqstp,
36173619
status = nfserr_wrong_cred;
36183620
if (!nfsd4_mach_creds_match(session->se_client, rqstp))
36193621
goto out;
3620-
status = nfsd4_match_existing_connection(rqstp, session, bcts->dir);
3621-
if (status == nfs_ok || status == nfserr_inval)
3622+
status = nfsd4_match_existing_connection(rqstp, session,
3623+
bcts->dir, &conn);
3624+
if (status == nfs_ok) {
3625+
if (bcts->dir == NFS4_CDFC4_FORE_OR_BOTH ||
3626+
bcts->dir == NFS4_CDFC4_BACK)
3627+
conn->cn_flags |= NFS4_CDFC4_BACK;
3628+
nfsd4_probe_callback(session->se_client);
3629+
goto out;
3630+
}
3631+
if (status == nfserr_inval)
36223632
goto out;
36233633
status = nfsd4_map_bcts_dir(&bcts->dir);
36243634
if (status)

0 commit comments

Comments
 (0)