diff options
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 8c77039e7a81..4700fae1ada0 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -3374,9 +3374,13 @@ static void nfs4_renew_done(struct rpc_task *task, void *calldata) | |||
3374 | 3374 | ||
3375 | if (task->tk_status < 0) { | 3375 | if (task->tk_status < 0) { |
3376 | /* Unless we're shutting down, schedule state recovery! */ | 3376 | /* Unless we're shutting down, schedule state recovery! */ |
3377 | if (test_bit(NFS_CS_RENEWD, &clp->cl_res_state) != 0) | 3377 | if (test_bit(NFS_CS_RENEWD, &clp->cl_res_state) == 0) |
3378 | return; | ||
3379 | if (task->tk_status != NFS4ERR_CB_PATH_DOWN) { | ||
3378 | nfs4_schedule_lease_recovery(clp); | 3380 | nfs4_schedule_lease_recovery(clp); |
3379 | return; | 3381 | return; |
3382 | } | ||
3383 | nfs4_schedule_path_down_recovery(clp); | ||
3380 | } | 3384 | } |
3381 | do_renew_lease(clp, timestamp); | 3385 | do_renew_lease(clp, timestamp); |
3382 | } | 3386 | } |
@@ -3386,7 +3390,7 @@ static const struct rpc_call_ops nfs4_renew_ops = { | |||
3386 | .rpc_release = nfs4_renew_release, | 3390 | .rpc_release = nfs4_renew_release, |
3387 | }; | 3391 | }; |
3388 | 3392 | ||
3389 | int nfs4_proc_async_renew(struct nfs_client *clp, struct rpc_cred *cred) | 3393 | static int nfs4_proc_async_renew(struct nfs_client *clp, struct rpc_cred *cred, unsigned renew_flags) |
3390 | { | 3394 | { |
3391 | struct rpc_message msg = { | 3395 | struct rpc_message msg = { |
3392 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RENEW], | 3396 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RENEW], |
@@ -3395,9 +3399,11 @@ int nfs4_proc_async_renew(struct nfs_client *clp, struct rpc_cred *cred) | |||
3395 | }; | 3399 | }; |
3396 | struct nfs4_renewdata *data; | 3400 | struct nfs4_renewdata *data; |
3397 | 3401 | ||
3402 | if (renew_flags == 0) | ||
3403 | return 0; | ||
3398 | if (!atomic_inc_not_zero(&clp->cl_count)) | 3404 | if (!atomic_inc_not_zero(&clp->cl_count)) |
3399 | return -EIO; | 3405 | return -EIO; |
3400 | data = kmalloc(sizeof(*data), GFP_KERNEL); | 3406 | data = kmalloc(sizeof(*data), GFP_NOFS); |
3401 | if (data == NULL) | 3407 | if (data == NULL) |
3402 | return -ENOMEM; | 3408 | return -ENOMEM; |
3403 | data->client = clp; | 3409 | data->client = clp; |
@@ -3406,7 +3412,7 @@ int nfs4_proc_async_renew(struct nfs_client *clp, struct rpc_cred *cred) | |||
3406 | &nfs4_renew_ops, data); | 3412 | &nfs4_renew_ops, data); |
3407 | } | 3413 | } |
3408 | 3414 | ||
3409 | int nfs4_proc_renew(struct nfs_client *clp, struct rpc_cred *cred) | 3415 | static int nfs4_proc_renew(struct nfs_client *clp, struct rpc_cred *cred) |
3410 | { | 3416 | { |
3411 | struct rpc_message msg = { | 3417 | struct rpc_message msg = { |
3412 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RENEW], | 3418 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RENEW], |
@@ -5504,11 +5510,13 @@ static struct rpc_task *_nfs41_proc_sequence(struct nfs_client *clp, struct rpc_ | |||
5504 | return rpc_run_task(&task_setup_data); | 5510 | return rpc_run_task(&task_setup_data); |
5505 | } | 5511 | } |
5506 | 5512 | ||
5507 | static int nfs41_proc_async_sequence(struct nfs_client *clp, struct rpc_cred *cred) | 5513 | static int nfs41_proc_async_sequence(struct nfs_client *clp, struct rpc_cred *cred, unsigned renew_flags) |
5508 | { | 5514 | { |
5509 | struct rpc_task *task; | 5515 | struct rpc_task *task; |
5510 | int ret = 0; | 5516 | int ret = 0; |
5511 | 5517 | ||
5518 | if ((renew_flags & NFS4_RENEW_TIMEOUT) == 0) | ||
5519 | return 0; | ||
5512 | task = _nfs41_proc_sequence(clp, cred); | 5520 | task = _nfs41_proc_sequence(clp, cred); |
5513 | if (IS_ERR(task)) | 5521 | if (IS_ERR(task)) |
5514 | ret = PTR_ERR(task); | 5522 | ret = PTR_ERR(task); |