aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2009-12-04 16:02:14 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-12-04 16:02:14 -0500
commit0b9e2d41f1f0360be08809d4e3bb56b67be6241a (patch)
tree6628c9ef423cf09a76ec34b6f9db64c7ca704c38
parent691daf3b0c410c8bcab6735796be03ea446e1924 (diff)
nfs41: only state manager sets NFS4CLNT_SESSION_SETUP
Replace sync and async handlers setting of the NFS4CLNT_SESSION_SETUP bit with setting NFS4CLNT_CHECK_LEASE, and let the state manager decide to reset the session. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/nfs4proc.c6
-rw-r--r--fs/nfs/nfs4state.c4
2 files changed, 6 insertions, 4 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index a0f73e99ff3d..637a6b476bd6 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -270,7 +270,7 @@ static int nfs4_handle_exception(const struct nfs_server *server, int errorcode,
270 case -NFS4ERR_SEQ_MISORDERED: 270 case -NFS4ERR_SEQ_MISORDERED:
271 dprintk("%s ERROR: %d Reset session\n", __func__, 271 dprintk("%s ERROR: %d Reset session\n", __func__,
272 errorcode); 272 errorcode);
273 set_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state); 273 nfs4_schedule_state_recovery(clp);
274 exception->retry = 1; 274 exception->retry = 1;
275 break; 275 break;
276#endif /* !defined(CONFIG_NFS_V4_1) */ 276#endif /* !defined(CONFIG_NFS_V4_1) */
@@ -466,7 +466,7 @@ static int nfs41_setup_sequence(struct nfs4_session *session,
466 tbl = &session->fc_slot_table; 466 tbl = &session->fc_slot_table;
467 467
468 spin_lock(&tbl->slot_tbl_lock); 468 spin_lock(&tbl->slot_tbl_lock);
469 if (test_bit(NFS4CLNT_SESSION_RESET, &session->clp->cl_state)) { 469 if (test_bit(NFS4CLNT_SESSION_DRAINING, &session->clp->cl_state)) {
470 /* 470 /*
471 * The state manager will wait until the slot table is empty. 471 * The state manager will wait until the slot table is empty.
472 * Schedule the reset thread 472 * Schedule the reset thread
@@ -3368,7 +3368,7 @@ _nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server,
3368 case -NFS4ERR_SEQ_MISORDERED: 3368 case -NFS4ERR_SEQ_MISORDERED:
3369 dprintk("%s ERROR %d, Reset session\n", __func__, 3369 dprintk("%s ERROR %d, Reset session\n", __func__,
3370 task->tk_status); 3370 task->tk_status);
3371 set_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state); 3371 nfs4_schedule_state_recovery(clp);
3372 task->tk_status = 0; 3372 task->tk_status = 0;
3373 return -EAGAIN; 3373 return -EAGAIN;
3374#endif /* CONFIG_NFS_V4_1 */ 3374#endif /* CONFIG_NFS_V4_1 */
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 3c1433598b60..46c69e2248e3 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1094,6 +1094,8 @@ static int nfs4_recovery_handle_error(struct nfs_client *clp, int error)
1094 case -NFS4ERR_SEQ_FALSE_RETRY: 1094 case -NFS4ERR_SEQ_FALSE_RETRY:
1095 case -NFS4ERR_SEQ_MISORDERED: 1095 case -NFS4ERR_SEQ_MISORDERED:
1096 set_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state); 1096 set_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state);
1097 /* Zero session reset errors */
1098 return 0;
1097 } 1099 }
1098 return error; 1100 return error;
1099} 1101}
@@ -1191,7 +1193,6 @@ static int nfs4_reset_session(struct nfs_client *clp)
1191 set_bit(NFS4CLNT_SESSION_DRAINING, &clp->cl_state); 1193 set_bit(NFS4CLNT_SESSION_DRAINING, &clp->cl_state);
1192 spin_unlock(&tbl->slot_tbl_lock); 1194 spin_unlock(&tbl->slot_tbl_lock);
1193 status = wait_for_completion_interruptible(&ses->complete); 1195 status = wait_for_completion_interruptible(&ses->complete);
1194 clear_bit(NFS4CLNT_SESSION_DRAINING, &clp->cl_state);
1195 if (status) /* -ERESTARTSYS */ 1196 if (status) /* -ERESTARTSYS */
1196 goto out; 1197 goto out;
1197 } else { 1198 } else {
@@ -1212,6 +1213,7 @@ static int nfs4_reset_session(struct nfs_client *clp)
1212 /* fall through*/ 1213 /* fall through*/
1213out: 1214out:
1214 /* Wake up the next rpc task even on error */ 1215 /* Wake up the next rpc task even on error */
1216 clear_bit(NFS4CLNT_SESSION_DRAINING, &clp->cl_state);
1215 rpc_wake_up_next(&clp->cl_session->fc_slot_table.slot_tbl_waitq); 1217 rpc_wake_up_next(&clp->cl_session->fc_slot_table.slot_tbl_waitq);
1216 return status; 1218 return status;
1217} 1219}