aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2009-12-03 15:53:20 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-12-03 15:53:20 -0500
commit4f7cdf18e14f81860b856ef7694ef58eb1a751c0 (patch)
treeac10a661705b816cbee8702df34149db14b51cdc /fs
parente345e88a774875cec26e097ea3ff2dc40c4f9da2 (diff)
NFSv4: The state manager shouldn't exit on errors that were handled
nfs4_recovery_handle_error() will correctly handle errors such as NFS4ERR_CB_PATH_DOWN, however because they are still passed back to the main loop in nfs4_state_manager(), they can cause the latter to exit prematurely. Fix this by letting nfs4_recovery_handle_error() change the error value in cases where there is no action required by the caller. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs4state.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 456631969a58..8f27b4f0a530 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1051,12 +1051,12 @@ static void nfs4_state_end_reclaim_nograce(struct nfs_client *clp)
1051 clear_bit(NFS4CLNT_RECLAIM_NOGRACE, &clp->cl_state); 1051 clear_bit(NFS4CLNT_RECLAIM_NOGRACE, &clp->cl_state);
1052} 1052}
1053 1053
1054static void nfs4_recovery_handle_error(struct nfs_client *clp, int error) 1054static int nfs4_recovery_handle_error(struct nfs_client *clp, int error)
1055{ 1055{
1056 switch (error) { 1056 switch (error) {
1057 case -NFS4ERR_CB_PATH_DOWN: 1057 case -NFS4ERR_CB_PATH_DOWN:
1058 nfs_handle_cb_pathdown(clp); 1058 nfs_handle_cb_pathdown(clp);
1059 break; 1059 return 0;
1060 case -NFS4ERR_STALE_CLIENTID: 1060 case -NFS4ERR_STALE_CLIENTID:
1061 case -NFS4ERR_LEASE_MOVED: 1061 case -NFS4ERR_LEASE_MOVED:
1062 set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); 1062 set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state);
@@ -1075,6 +1075,7 @@ static void nfs4_recovery_handle_error(struct nfs_client *clp, int error)
1075 case -NFS4ERR_SEQ_MISORDERED: 1075 case -NFS4ERR_SEQ_MISORDERED:
1076 set_bit(NFS4CLNT_SESSION_SETUP, &clp->cl_state); 1076 set_bit(NFS4CLNT_SESSION_SETUP, &clp->cl_state);
1077 } 1077 }
1078 return error;
1078} 1079}
1079 1080
1080static int nfs4_do_reclaim(struct nfs_client *clp, const struct nfs4_state_recovery_ops *ops) 1081static int nfs4_do_reclaim(struct nfs_client *clp, const struct nfs4_state_recovery_ops *ops)
@@ -1094,8 +1095,7 @@ restart:
1094 if (status < 0) { 1095 if (status < 0) {
1095 set_bit(ops->owner_flag_bit, &sp->so_flags); 1096 set_bit(ops->owner_flag_bit, &sp->so_flags);
1096 nfs4_put_state_owner(sp); 1097 nfs4_put_state_owner(sp);
1097 nfs4_recovery_handle_error(clp, status); 1098 return nfs4_recovery_handle_error(clp, status);
1098 return status;
1099 } 1099 }
1100 nfs4_put_state_owner(sp); 1100 nfs4_put_state_owner(sp);
1101 goto restart; 1101 goto restart;
@@ -1125,8 +1125,7 @@ static int nfs4_check_lease(struct nfs_client *clp)
1125 status = ops->renew_lease(clp, cred); 1125 status = ops->renew_lease(clp, cred);
1126 put_rpccred(cred); 1126 put_rpccred(cred);
1127out: 1127out:
1128 nfs4_recovery_handle_error(clp, status); 1128 return nfs4_recovery_handle_error(clp, status);
1129 return status;
1130} 1129}
1131 1130
1132static int nfs4_reclaim_lease(struct nfs_client *clp) 1131static int nfs4_reclaim_lease(struct nfs_client *clp)