aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2017-05-04 13:44:04 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2017-05-05 12:01:50 -0400
commit0048fdd06614a4ea088f9fcad11511956b795698 (patch)
tree2237937ba40fce070fc6d3a80f8ddcf47d41e044
parentc296cfe26bdd86de6eeefde57d333174ed9574d0 (diff)
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: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Tested-by: Chuck Lever <chuck.lever@oracle.com>
-rw-r--r--fs/nfs/nfs4proc.c7
-rw-r--r--fs/nfs/nfs4state.c10
2 files changed, 13 insertions, 4 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 158c3d52146f..62fc8eed53cc 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -8153,6 +8153,12 @@ static int nfs41_reclaim_complete_handle_errors(struct rpc_task *task, struct nf
8153 /* fall through */ 8153 /* fall through */
8154 case -NFS4ERR_RETRY_UNCACHED_REP: 8154 case -NFS4ERR_RETRY_UNCACHED_REP:
8155 return -EAGAIN; 8155 return -EAGAIN;
8156 case -NFS4ERR_BADSESSION:
8157 case -NFS4ERR_DEADSESSION:
8158 case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION:
8159 nfs4_schedule_session_recovery(clp->cl_session,
8160 task->tk_status);
8161 break;
8156 default: 8162 default:
8157 nfs4_schedule_lease_recovery(clp); 8163 nfs4_schedule_lease_recovery(clp);
8158 } 8164 }
@@ -8231,7 +8237,6 @@ static int nfs41_proc_reclaim_complete(struct nfs_client *clp,
8231 if (status == 0) 8237 if (status == 0)
8232 status = task->tk_status; 8238 status = task->tk_status;
8233 rpc_put_task(task); 8239 rpc_put_task(task);
8234 return 0;
8235out: 8240out:
8236 dprintk("<-- %s status=%d\n", __func__, status); 8241 dprintk("<-- %s status=%d\n", __func__, status);
8237 return status; 8242 return status;
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 8156bad6b441..b34de036501b 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1649,13 +1649,14 @@ static void nfs4_state_start_reclaim_reboot(struct nfs_client *clp)
1649 nfs4_state_mark_reclaim_helper(clp, nfs4_state_mark_reclaim_reboot); 1649 nfs4_state_mark_reclaim_helper(clp, nfs4_state_mark_reclaim_reboot);
1650} 1650}
1651 1651
1652static void nfs4_reclaim_complete(struct nfs_client *clp, 1652static int nfs4_reclaim_complete(struct nfs_client *clp,
1653 const struct nfs4_state_recovery_ops *ops, 1653 const struct nfs4_state_recovery_ops *ops,
1654 struct rpc_cred *cred) 1654 struct rpc_cred *cred)
1655{ 1655{
1656 /* Notify the server we're done reclaiming our state */ 1656 /* Notify the server we're done reclaiming our state */
1657 if (ops->reclaim_complete) 1657 if (ops->reclaim_complete)
1658 (void)ops->reclaim_complete(clp, cred); 1658 return ops->reclaim_complete(clp, cred);
1659 return 0;
1659} 1660}
1660 1661
1661static void nfs4_clear_reclaim_server(struct nfs_server *server) 1662static 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{ 1703{
1703 const struct nfs4_state_recovery_ops *ops; 1704 const struct nfs4_state_recovery_ops *ops;
1704 struct rpc_cred *cred; 1705 struct rpc_cred *cred;
1706 int err;
1705 1707
1706 if (!nfs4_state_clear_reclaim_reboot(clp)) 1708 if (!nfs4_state_clear_reclaim_reboot(clp))
1707 return; 1709 return;
1708 ops = clp->cl_mvops->reboot_recovery_ops; 1710 ops = clp->cl_mvops->reboot_recovery_ops;
1709 cred = nfs4_get_clid_cred(clp); 1711 cred = nfs4_get_clid_cred(clp);
1710 nfs4_reclaim_complete(clp, ops, cred); 1712 err = nfs4_reclaim_complete(clp, ops, cred);
1711 put_rpccred(cred); 1713 put_rpccred(cred);
1714 if (err == -NFS4ERR_CONN_NOT_BOUND_TO_SESSION)
1715 set_bit(NFS4CLNT_RECLAIM_REBOOT, &clp->cl_state);
1712} 1716}
1713 1717
1714static void nfs4_state_start_reclaim_nograce(struct nfs_client *clp) 1718static void nfs4_state_start_reclaim_nograce(struct nfs_client *clp)