Commit 0048fdd0 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4.1: RECLAIM_COMPLETE must handle NFS4ERR_CONN_NOT_BOUND_TO_SESSION

If the server returns NFS4ERR_CONN_NOT_BOUND_TO_SESSION because we
are trunking, then RECLAIM_COMPLETE must handle that by calling
nfs4_schedule_session_recovery() and then retrying.
Reported-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Tested-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent c296cfe2
...@@ -8153,6 +8153,12 @@ static int nfs41_reclaim_complete_handle_errors(struct rpc_task *task, struct nf ...@@ -8153,6 +8153,12 @@ static int nfs41_reclaim_complete_handle_errors(struct rpc_task *task, struct nf
/* fall through */ /* fall through */
case -NFS4ERR_RETRY_UNCACHED_REP: case -NFS4ERR_RETRY_UNCACHED_REP:
return -EAGAIN; return -EAGAIN;
case -NFS4ERR_BADSESSION:
case -NFS4ERR_DEADSESSION:
case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION:
nfs4_schedule_session_recovery(clp->cl_session,
task->tk_status);
break;
default: default:
nfs4_schedule_lease_recovery(clp); nfs4_schedule_lease_recovery(clp);
} }
...@@ -8231,7 +8237,6 @@ static int nfs41_proc_reclaim_complete(struct nfs_client *clp, ...@@ -8231,7 +8237,6 @@ static int nfs41_proc_reclaim_complete(struct nfs_client *clp,
if (status == 0) if (status == 0)
status = task->tk_status; status = task->tk_status;
rpc_put_task(task); rpc_put_task(task);
return 0;
out: out:
dprintk("<-- %s status=%d\n", __func__, status); dprintk("<-- %s status=%d\n", __func__, status);
return status; return status;
......
...@@ -1649,13 +1649,14 @@ static void nfs4_state_start_reclaim_reboot(struct nfs_client *clp) ...@@ -1649,13 +1649,14 @@ static void nfs4_state_start_reclaim_reboot(struct nfs_client *clp)
nfs4_state_mark_reclaim_helper(clp, nfs4_state_mark_reclaim_reboot); nfs4_state_mark_reclaim_helper(clp, nfs4_state_mark_reclaim_reboot);
} }
static void nfs4_reclaim_complete(struct nfs_client *clp, static int nfs4_reclaim_complete(struct nfs_client *clp,
const struct nfs4_state_recovery_ops *ops, const struct nfs4_state_recovery_ops *ops,
struct rpc_cred *cred) struct rpc_cred *cred)
{ {
/* Notify the server we're done reclaiming our state */ /* Notify the server we're done reclaiming our state */
if (ops->reclaim_complete) if (ops->reclaim_complete)
(void)ops->reclaim_complete(clp, cred); return ops->reclaim_complete(clp, cred);
return 0;
} }
static void nfs4_clear_reclaim_server(struct nfs_server *server) static void nfs4_clear_reclaim_server(struct nfs_server *server)
...@@ -1702,13 +1703,16 @@ static void nfs4_state_end_reclaim_reboot(struct nfs_client *clp) ...@@ -1702,13 +1703,16 @@ static void nfs4_state_end_reclaim_reboot(struct nfs_client *clp)
{ {
const struct nfs4_state_recovery_ops *ops; const struct nfs4_state_recovery_ops *ops;
struct rpc_cred *cred; struct rpc_cred *cred;
int err;
if (!nfs4_state_clear_reclaim_reboot(clp)) if (!nfs4_state_clear_reclaim_reboot(clp))
return; return;
ops = clp->cl_mvops->reboot_recovery_ops; ops = clp->cl_mvops->reboot_recovery_ops;
cred = nfs4_get_clid_cred(clp); cred = nfs4_get_clid_cred(clp);
nfs4_reclaim_complete(clp, ops, cred); err = nfs4_reclaim_complete(clp, ops, cred);
put_rpccred(cred); put_rpccred(cred);
if (err == -NFS4ERR_CONN_NOT_BOUND_TO_SESSION)
set_bit(NFS4CLNT_RECLAIM_REBOOT, &clp->cl_state);
} }
static void nfs4_state_start_reclaim_nograce(struct nfs_client *clp) static void nfs4_state_start_reclaim_nograce(struct nfs_client *clp)
......
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