diff options
-rw-r--r-- | fs/nfs/nfs4state.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 18e8b26878c5..6d263ed79e92 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -176,6 +176,7 @@ int nfs41_init_clientid(struct nfs_client *clp, struct rpc_cred *cred) | |||
176 | { | 176 | { |
177 | int status; | 177 | int status; |
178 | 178 | ||
179 | nfs4_begin_drain_session(clp); | ||
179 | status = nfs4_proc_exchange_id(clp, cred); | 180 | status = nfs4_proc_exchange_id(clp, cred); |
180 | if (status != 0) | 181 | if (status != 0) |
181 | goto out; | 182 | goto out; |
@@ -1274,6 +1275,7 @@ static int nfs4_reset_session(struct nfs_client *clp) | |||
1274 | { | 1275 | { |
1275 | int status; | 1276 | int status; |
1276 | 1277 | ||
1278 | nfs4_begin_drain_session(clp); | ||
1277 | status = nfs4_proc_destroy_session(clp->cl_session); | 1279 | status = nfs4_proc_destroy_session(clp->cl_session); |
1278 | if (status && status != -NFS4ERR_BADSESSION && | 1280 | if (status && status != -NFS4ERR_BADSESSION && |
1279 | status != -NFS4ERR_DEADSESSION) { | 1281 | status != -NFS4ERR_DEADSESSION) { |
@@ -1299,7 +1301,6 @@ out: | |||
1299 | 1301 | ||
1300 | #else /* CONFIG_NFS_V4_1 */ | 1302 | #else /* CONFIG_NFS_V4_1 */ |
1301 | static int nfs4_reset_session(struct nfs_client *clp) { return 0; } | 1303 | static int nfs4_reset_session(struct nfs_client *clp) { return 0; } |
1302 | static int nfs4_begin_drain_session(struct nfs_client *clp) { return 0; } | ||
1303 | static int nfs4_end_drain_session(struct nfs_client *clp) { return 0; } | 1304 | static int nfs4_end_drain_session(struct nfs_client *clp) { return 0; } |
1304 | #endif /* CONFIG_NFS_V4_1 */ | 1305 | #endif /* CONFIG_NFS_V4_1 */ |
1305 | 1306 | ||
@@ -1332,7 +1333,6 @@ static void nfs4_state_manager(struct nfs_client *clp) | |||
1332 | for(;;) { | 1333 | for(;;) { |
1333 | if (test_and_clear_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) { | 1334 | if (test_and_clear_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) { |
1334 | /* We're going to have to re-establish a clientid */ | 1335 | /* We're going to have to re-establish a clientid */ |
1335 | nfs4_begin_drain_session(clp); | ||
1336 | status = nfs4_reclaim_lease(clp); | 1336 | status = nfs4_reclaim_lease(clp); |
1337 | if (status) { | 1337 | if (status) { |
1338 | nfs4_set_lease_expired(clp, status); | 1338 | nfs4_set_lease_expired(clp, status); |
@@ -1359,7 +1359,6 @@ static void nfs4_state_manager(struct nfs_client *clp) | |||
1359 | /* Initialize or reset the session */ | 1359 | /* Initialize or reset the session */ |
1360 | if (test_and_clear_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state) | 1360 | if (test_and_clear_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state) |
1361 | && nfs4_has_session(clp)) { | 1361 | && nfs4_has_session(clp)) { |
1362 | nfs4_begin_drain_session(clp); | ||
1363 | status = nfs4_reset_session(clp); | 1362 | status = nfs4_reset_session(clp); |
1364 | if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) | 1363 | if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) |
1365 | continue; | 1364 | continue; |