diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-10-19 19:47:49 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-10-23 15:27:28 -0400 |
commit | 168667c43bbafff11b46014a1e94477ff7619f45 (patch) | |
tree | 903bf11fe3b53fe0e7db6ab38d2bdc8933576879 /fs/nfs/nfs4state.c | |
parent | 898f635c4297e91ceac675d83c4a460f26118342 (diff) |
NFSv4: The state manager must ignore EKEYEXPIRED.
Otherwise, we cannot recover state correctly.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4state.c')
-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 940cf7c070af..40028ac2b69c 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -1063,6 +1063,14 @@ restart: | |||
1063 | /* Mark the file as being 'closed' */ | 1063 | /* Mark the file as being 'closed' */ |
1064 | state->state = 0; | 1064 | state->state = 0; |
1065 | break; | 1065 | break; |
1066 | case -EKEYEXPIRED: | ||
1067 | /* | ||
1068 | * User RPCSEC_GSS context has expired. | ||
1069 | * We cannot recover this stateid now, so | ||
1070 | * skip it and allow recovery thread to | ||
1071 | * proceed. | ||
1072 | */ | ||
1073 | break; | ||
1066 | case -NFS4ERR_ADMIN_REVOKED: | 1074 | case -NFS4ERR_ADMIN_REVOKED: |
1067 | case -NFS4ERR_STALE_STATEID: | 1075 | case -NFS4ERR_STALE_STATEID: |
1068 | case -NFS4ERR_BAD_STATEID: | 1076 | case -NFS4ERR_BAD_STATEID: |
@@ -1181,6 +1189,14 @@ static void nfs4_state_start_reclaim_nograce(struct nfs_client *clp) | |||
1181 | nfs4_state_mark_reclaim_helper(clp, nfs4_state_mark_reclaim_nograce); | 1189 | nfs4_state_mark_reclaim_helper(clp, nfs4_state_mark_reclaim_nograce); |
1182 | } | 1190 | } |
1183 | 1191 | ||
1192 | static void nfs4_warn_keyexpired(const char *s) | ||
1193 | { | ||
1194 | printk_ratelimited(KERN_WARNING "Error: state manager" | ||
1195 | " encountered RPCSEC_GSS session" | ||
1196 | " expired against NFSv4 server %s.\n", | ||
1197 | s); | ||
1198 | } | ||
1199 | |||
1184 | static int nfs4_recovery_handle_error(struct nfs_client *clp, int error) | 1200 | static int nfs4_recovery_handle_error(struct nfs_client *clp, int error) |
1185 | { | 1201 | { |
1186 | switch (error) { | 1202 | switch (error) { |
@@ -1210,6 +1226,10 @@ static int nfs4_recovery_handle_error(struct nfs_client *clp, int error) | |||
1210 | set_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state); | 1226 | set_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state); |
1211 | /* Zero session reset errors */ | 1227 | /* Zero session reset errors */ |
1212 | return 0; | 1228 | return 0; |
1229 | case -EKEYEXPIRED: | ||
1230 | /* Nothing we can do */ | ||
1231 | nfs4_warn_keyexpired(clp->cl_hostname); | ||
1232 | return 0; | ||
1213 | } | 1233 | } |
1214 | return error; | 1234 | return error; |
1215 | } | 1235 | } |
@@ -1420,9 +1440,10 @@ static void nfs4_set_lease_expired(struct nfs_client *clp, int status) | |||
1420 | case -NFS4ERR_DELAY: | 1440 | case -NFS4ERR_DELAY: |
1421 | case -NFS4ERR_CLID_INUSE: | 1441 | case -NFS4ERR_CLID_INUSE: |
1422 | case -EAGAIN: | 1442 | case -EAGAIN: |
1423 | case -EKEYEXPIRED: | ||
1424 | break; | 1443 | break; |
1425 | 1444 | ||
1445 | case -EKEYEXPIRED: | ||
1446 | nfs4_warn_keyexpired(clp->cl_hostname); | ||
1426 | case -NFS4ERR_NOT_SAME: /* FixMe: implement recovery | 1447 | case -NFS4ERR_NOT_SAME: /* FixMe: implement recovery |
1427 | * in nfs4_exchange_id */ | 1448 | * in nfs4_exchange_id */ |
1428 | default: | 1449 | default: |