diff options
author | Andy Adamson <andros@netapp.com> | 2009-06-16 14:43:15 -0400 |
---|---|---|
committer | Benny Halevy <bhalevy@panasas.com> | 2009-06-17 15:43:44 -0400 |
commit | 78722e9c9208a312695178f5331511badd190598 (patch) | |
tree | 9aeaea994040d090b9ecfb5f8b7c8fe91375262a /fs/nfs | |
parent | 008f55d0e019943323c20a03493a2ba5672a4cc8 (diff) |
nfs41: only retry EXCHANGE_ID on recoverable errors
Stops an infinite loop of EXCHANGE_ID.
Signed-off-by: Andy Adamson <andros@netapp.com>
[fixed checkpatch warnings]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4state.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 7dc971335ec2..2cc0aca96eb2 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -1183,6 +1183,27 @@ static int nfs4_reset_session(struct nfs_client *clp) { return 0; } | |||
1183 | static int nfs4_initialize_session(struct nfs_client *clp) { return 0; } | 1183 | static int nfs4_initialize_session(struct nfs_client *clp) { return 0; } |
1184 | #endif /* CONFIG_NFS_V4_1 */ | 1184 | #endif /* CONFIG_NFS_V4_1 */ |
1185 | 1185 | ||
1186 | /* Set NFS4CLNT_LEASE_EXPIRED for all v4.0 errors and for recoverable errors | ||
1187 | * on EXCHANGE_ID for v4.1 | ||
1188 | */ | ||
1189 | static void nfs4_set_lease_expired(struct nfs_client *clp, int status) | ||
1190 | { | ||
1191 | if (nfs4_has_session(clp)) { | ||
1192 | switch (status) { | ||
1193 | case -NFS4ERR_DELAY: | ||
1194 | case -NFS4ERR_CLID_INUSE: | ||
1195 | case -EAGAIN: | ||
1196 | break; | ||
1197 | |||
1198 | case -NFS4ERR_NOT_SAME: /* FixMe: implement recovery | ||
1199 | * in nfs4_exchange_id */ | ||
1200 | default: | ||
1201 | return; | ||
1202 | } | ||
1203 | } | ||
1204 | set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); | ||
1205 | } | ||
1206 | |||
1186 | static void nfs4_state_manager(struct nfs_client *clp) | 1207 | static void nfs4_state_manager(struct nfs_client *clp) |
1187 | { | 1208 | { |
1188 | int status = 0; | 1209 | int status = 0; |
@@ -1193,7 +1214,7 @@ static void nfs4_state_manager(struct nfs_client *clp) | |||
1193 | /* We're going to have to re-establish a clientid */ | 1214 | /* We're going to have to re-establish a clientid */ |
1194 | status = nfs4_reclaim_lease(clp); | 1215 | status = nfs4_reclaim_lease(clp); |
1195 | if (status) { | 1216 | if (status) { |
1196 | set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); | 1217 | nfs4_set_lease_expired(clp, status); |
1197 | if (status == -EAGAIN) | 1218 | if (status == -EAGAIN) |
1198 | continue; | 1219 | continue; |
1199 | if (clp->cl_cons_state == | 1220 | if (clp->cl_cons_state == |