diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-07-05 15:12:06 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-07-05 15:46:38 -0400 |
commit | 8b895ce652dc73bcf42a0c24acfc0708a06ea7c3 (patch) | |
tree | fa3d7e1ff7cde226cb3d67e6f579e086cc217e5e | |
parent | b5872f0c67edf3714dd46f04d73c3644f3addaf9 (diff) |
NFSv4.1: Handle SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED status bit correctly.
If the server tells us that only some state has been revoked, then we
need to run the full TEST_STATEID dog and pony show in order to discover
which locks and delegations are still OK. Currently we blow away all
state, which means that we lose all locks!
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r-- | fs/nfs/nfs4state.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 605840dc89cf..f76916169b5f 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -2191,12 +2191,20 @@ static void nfs41_handle_server_reboot(struct nfs_client *clp) | |||
2191 | } | 2191 | } |
2192 | } | 2192 | } |
2193 | 2193 | ||
2194 | static void nfs41_handle_state_revoked(struct nfs_client *clp) | 2194 | static void nfs41_handle_all_state_revoked(struct nfs_client *clp) |
2195 | { | 2195 | { |
2196 | nfs4_reset_all_state(clp); | 2196 | nfs4_reset_all_state(clp); |
2197 | dprintk("%s: state revoked on server %s\n", __func__, clp->cl_hostname); | 2197 | dprintk("%s: state revoked on server %s\n", __func__, clp->cl_hostname); |
2198 | } | 2198 | } |
2199 | 2199 | ||
2200 | static void nfs41_handle_some_state_revoked(struct nfs_client *clp) | ||
2201 | { | ||
2202 | nfs4_state_mark_reclaim_helper(clp, nfs4_state_mark_reclaim_nograce); | ||
2203 | nfs4_schedule_state_manager(clp); | ||
2204 | |||
2205 | dprintk("%s: state revoked on server %s\n", __func__, clp->cl_hostname); | ||
2206 | } | ||
2207 | |||
2200 | static void nfs41_handle_recallable_state_revoked(struct nfs_client *clp) | 2208 | static void nfs41_handle_recallable_state_revoked(struct nfs_client *clp) |
2201 | { | 2209 | { |
2202 | /* This will need to handle layouts too */ | 2210 | /* This will need to handle layouts too */ |
@@ -2231,10 +2239,11 @@ void nfs41_handle_sequence_flag_errors(struct nfs_client *clp, u32 flags) | |||
2231 | 2239 | ||
2232 | if (flags & SEQ4_STATUS_RESTART_RECLAIM_NEEDED) | 2240 | if (flags & SEQ4_STATUS_RESTART_RECLAIM_NEEDED) |
2233 | nfs41_handle_server_reboot(clp); | 2241 | nfs41_handle_server_reboot(clp); |
2234 | if (flags & (SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED | | 2242 | if (flags & (SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED)) |
2235 | SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED | | 2243 | nfs41_handle_all_state_revoked(clp); |
2244 | if (flags & (SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED | | ||
2236 | SEQ4_STATUS_ADMIN_STATE_REVOKED)) | 2245 | SEQ4_STATUS_ADMIN_STATE_REVOKED)) |
2237 | nfs41_handle_state_revoked(clp); | 2246 | nfs41_handle_some_state_revoked(clp); |
2238 | if (flags & SEQ4_STATUS_LEASE_MOVED) | 2247 | if (flags & SEQ4_STATUS_LEASE_MOVED) |
2239 | nfs4_schedule_lease_moved_recovery(clp); | 2248 | nfs4_schedule_lease_moved_recovery(clp); |
2240 | if (flags & SEQ4_STATUS_RECALLABLE_STATE_REVOKED) | 2249 | if (flags & SEQ4_STATUS_RECALLABLE_STATE_REVOKED) |