diff options
Diffstat (limited to 'fs/nfs/nfs4state.c')
-rw-r--r-- | fs/nfs/nfs4state.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index ffea57885394..d8decf2ec48f 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -1210,6 +1210,7 @@ void nfs4_schedule_state_manager(struct nfs_client *clp) | |||
1210 | struct task_struct *task; | 1210 | struct task_struct *task; |
1211 | char buf[INET6_ADDRSTRLEN + sizeof("-manager") + 1]; | 1211 | char buf[INET6_ADDRSTRLEN + sizeof("-manager") + 1]; |
1212 | 1212 | ||
1213 | set_bit(NFS4CLNT_RUN_MANAGER, &clp->cl_state); | ||
1213 | if (test_and_set_bit(NFS4CLNT_MANAGER_RUNNING, &clp->cl_state) != 0) | 1214 | if (test_and_set_bit(NFS4CLNT_MANAGER_RUNNING, &clp->cl_state) != 0) |
1214 | return; | 1215 | return; |
1215 | __module_get(THIS_MODULE); | 1216 | __module_get(THIS_MODULE); |
@@ -2503,6 +2504,7 @@ static void nfs4_state_manager(struct nfs_client *clp) | |||
2503 | 2504 | ||
2504 | /* Ensure exclusive access to NFSv4 state */ | 2505 | /* Ensure exclusive access to NFSv4 state */ |
2505 | do { | 2506 | do { |
2507 | clear_bit(NFS4CLNT_RUN_MANAGER, &clp->cl_state); | ||
2506 | if (test_bit(NFS4CLNT_PURGE_STATE, &clp->cl_state)) { | 2508 | if (test_bit(NFS4CLNT_PURGE_STATE, &clp->cl_state)) { |
2507 | section = "purge state"; | 2509 | section = "purge state"; |
2508 | status = nfs4_purge_lease(clp); | 2510 | status = nfs4_purge_lease(clp); |
@@ -2593,14 +2595,18 @@ static void nfs4_state_manager(struct nfs_client *clp) | |||
2593 | } | 2595 | } |
2594 | 2596 | ||
2595 | nfs4_end_drain_session(clp); | 2597 | nfs4_end_drain_session(clp); |
2596 | if (test_and_clear_bit(NFS4CLNT_DELEGRETURN, &clp->cl_state)) { | 2598 | nfs4_clear_state_manager_bit(clp); |
2597 | nfs_client_return_marked_delegations(clp); | 2599 | |
2598 | continue; | 2600 | if (!test_and_set_bit(NFS4CLNT_DELEGRETURN_RUNNING, &clp->cl_state)) { |
2601 | if (test_and_clear_bit(NFS4CLNT_DELEGRETURN, &clp->cl_state)) { | ||
2602 | nfs_client_return_marked_delegations(clp); | ||
2603 | set_bit(NFS4CLNT_RUN_MANAGER, &clp->cl_state); | ||
2604 | } | ||
2605 | clear_bit(NFS4CLNT_DELEGRETURN_RUNNING, &clp->cl_state); | ||
2599 | } | 2606 | } |
2600 | 2607 | ||
2601 | nfs4_clear_state_manager_bit(clp); | ||
2602 | /* Did we race with an attempt to give us more work? */ | 2608 | /* Did we race with an attempt to give us more work? */ |
2603 | if (clp->cl_state == 0) | 2609 | if (!test_bit(NFS4CLNT_RUN_MANAGER, &clp->cl_state)) |
2604 | return; | 2610 | return; |
2605 | if (test_and_set_bit(NFS4CLNT_MANAGER_RUNNING, &clp->cl_state) != 0) | 2611 | if (test_and_set_bit(NFS4CLNT_MANAGER_RUNNING, &clp->cl_state) != 0) |
2606 | return; | 2612 | return; |