diff options
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 68b21d81b7ac..5eec4429970c 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -339,8 +339,7 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc | |||
339 | dprintk("%s ERROR: %d Reset session\n", __func__, | 339 | dprintk("%s ERROR: %d Reset session\n", __func__, |
340 | errorcode); | 340 | errorcode); |
341 | nfs4_schedule_session_recovery(clp->cl_session, errorcode); | 341 | nfs4_schedule_session_recovery(clp->cl_session, errorcode); |
342 | exception->retry = 1; | 342 | goto wait_on_recovery; |
343 | break; | ||
344 | #endif /* defined(CONFIG_NFS_V4_1) */ | 343 | #endif /* defined(CONFIG_NFS_V4_1) */ |
345 | case -NFS4ERR_FILE_OPEN: | 344 | case -NFS4ERR_FILE_OPEN: |
346 | if (exception->timeout > HZ) { | 345 | if (exception->timeout > HZ) { |
@@ -1572,9 +1571,11 @@ static void nfs4_open_prepare(struct rpc_task *task, void *calldata) | |||
1572 | data->timestamp = jiffies; | 1571 | data->timestamp = jiffies; |
1573 | if (nfs4_setup_sequence(data->o_arg.server, | 1572 | if (nfs4_setup_sequence(data->o_arg.server, |
1574 | &data->o_arg.seq_args, | 1573 | &data->o_arg.seq_args, |
1575 | &data->o_res.seq_res, task)) | 1574 | &data->o_res.seq_res, |
1576 | return; | 1575 | task) != 0) |
1577 | rpc_call_start(task); | 1576 | nfs_release_seqid(data->o_arg.seqid); |
1577 | else | ||
1578 | rpc_call_start(task); | ||
1578 | return; | 1579 | return; |
1579 | unlock_no_action: | 1580 | unlock_no_action: |
1580 | rcu_read_unlock(); | 1581 | rcu_read_unlock(); |
@@ -1748,7 +1749,7 @@ static int nfs4_opendata_access(struct rpc_cred *cred, | |||
1748 | 1749 | ||
1749 | /* even though OPEN succeeded, access is denied. Close the file */ | 1750 | /* even though OPEN succeeded, access is denied. Close the file */ |
1750 | nfs4_close_state(state, fmode); | 1751 | nfs4_close_state(state, fmode); |
1751 | return -NFS4ERR_ACCESS; | 1752 | return -EACCES; |
1752 | } | 1753 | } |
1753 | 1754 | ||
1754 | /* | 1755 | /* |
@@ -2196,7 +2197,7 @@ static void nfs4_free_closedata(void *data) | |||
2196 | nfs4_put_open_state(calldata->state); | 2197 | nfs4_put_open_state(calldata->state); |
2197 | nfs_free_seqid(calldata->arg.seqid); | 2198 | nfs_free_seqid(calldata->arg.seqid); |
2198 | nfs4_put_state_owner(sp); | 2199 | nfs4_put_state_owner(sp); |
2199 | nfs_sb_deactive(sb); | 2200 | nfs_sb_deactive_async(sb); |
2200 | kfree(calldata); | 2201 | kfree(calldata); |
2201 | } | 2202 | } |
2202 | 2203 | ||
@@ -2296,9 +2297,10 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data) | |||
2296 | if (nfs4_setup_sequence(NFS_SERVER(inode), | 2297 | if (nfs4_setup_sequence(NFS_SERVER(inode), |
2297 | &calldata->arg.seq_args, | 2298 | &calldata->arg.seq_args, |
2298 | &calldata->res.seq_res, | 2299 | &calldata->res.seq_res, |
2299 | task)) | 2300 | task) != 0) |
2300 | goto out; | 2301 | nfs_release_seqid(calldata->arg.seqid); |
2301 | rpc_call_start(task); | 2302 | else |
2303 | rpc_call_start(task); | ||
2302 | out: | 2304 | out: |
2303 | dprintk("%s: done!\n", __func__); | 2305 | dprintk("%s: done!\n", __func__); |
2304 | } | 2306 | } |
@@ -4529,6 +4531,7 @@ static void nfs4_locku_done(struct rpc_task *task, void *data) | |||
4529 | if (nfs4_async_handle_error(task, calldata->server, NULL) == -EAGAIN) | 4531 | if (nfs4_async_handle_error(task, calldata->server, NULL) == -EAGAIN) |
4530 | rpc_restart_call_prepare(task); | 4532 | rpc_restart_call_prepare(task); |
4531 | } | 4533 | } |
4534 | nfs_release_seqid(calldata->arg.seqid); | ||
4532 | } | 4535 | } |
4533 | 4536 | ||
4534 | static void nfs4_locku_prepare(struct rpc_task *task, void *data) | 4537 | static void nfs4_locku_prepare(struct rpc_task *task, void *data) |
@@ -4545,9 +4548,11 @@ static void nfs4_locku_prepare(struct rpc_task *task, void *data) | |||
4545 | calldata->timestamp = jiffies; | 4548 | calldata->timestamp = jiffies; |
4546 | if (nfs4_setup_sequence(calldata->server, | 4549 | if (nfs4_setup_sequence(calldata->server, |
4547 | &calldata->arg.seq_args, | 4550 | &calldata->arg.seq_args, |
4548 | &calldata->res.seq_res, task)) | 4551 | &calldata->res.seq_res, |
4549 | return; | 4552 | task) != 0) |
4550 | rpc_call_start(task); | 4553 | nfs_release_seqid(calldata->arg.seqid); |
4554 | else | ||
4555 | rpc_call_start(task); | ||
4551 | } | 4556 | } |
4552 | 4557 | ||
4553 | static const struct rpc_call_ops nfs4_locku_ops = { | 4558 | static const struct rpc_call_ops nfs4_locku_ops = { |
@@ -4692,7 +4697,7 @@ static void nfs4_lock_prepare(struct rpc_task *task, void *calldata) | |||
4692 | /* Do we need to do an open_to_lock_owner? */ | 4697 | /* Do we need to do an open_to_lock_owner? */ |
4693 | if (!(data->arg.lock_seqid->sequence->flags & NFS_SEQID_CONFIRMED)) { | 4698 | if (!(data->arg.lock_seqid->sequence->flags & NFS_SEQID_CONFIRMED)) { |
4694 | if (nfs_wait_on_sequence(data->arg.open_seqid, task) != 0) | 4699 | if (nfs_wait_on_sequence(data->arg.open_seqid, task) != 0) |
4695 | return; | 4700 | goto out_release_lock_seqid; |
4696 | data->arg.open_stateid = &state->stateid; | 4701 | data->arg.open_stateid = &state->stateid; |
4697 | data->arg.new_lock_owner = 1; | 4702 | data->arg.new_lock_owner = 1; |
4698 | data->res.open_seqid = data->arg.open_seqid; | 4703 | data->res.open_seqid = data->arg.open_seqid; |
@@ -4701,10 +4706,15 @@ static void nfs4_lock_prepare(struct rpc_task *task, void *calldata) | |||
4701 | data->timestamp = jiffies; | 4706 | data->timestamp = jiffies; |
4702 | if (nfs4_setup_sequence(data->server, | 4707 | if (nfs4_setup_sequence(data->server, |
4703 | &data->arg.seq_args, | 4708 | &data->arg.seq_args, |
4704 | &data->res.seq_res, task)) | 4709 | &data->res.seq_res, |
4710 | task) == 0) { | ||
4711 | rpc_call_start(task); | ||
4705 | return; | 4712 | return; |
4706 | rpc_call_start(task); | 4713 | } |
4707 | dprintk("%s: done!, ret = %d\n", __func__, data->rpc_status); | 4714 | nfs_release_seqid(data->arg.open_seqid); |
4715 | out_release_lock_seqid: | ||
4716 | nfs_release_seqid(data->arg.lock_seqid); | ||
4717 | dprintk("%s: done!, ret = %d\n", __func__, task->tk_status); | ||
4708 | } | 4718 | } |
4709 | 4719 | ||
4710 | static void nfs4_recover_lock_prepare(struct rpc_task *task, void *calldata) | 4720 | static void nfs4_recover_lock_prepare(struct rpc_task *task, void *calldata) |
@@ -5667,7 +5677,7 @@ static void nfs4_add_and_init_slots(struct nfs4_slot_table *tbl, | |||
5667 | tbl->slots = new; | 5677 | tbl->slots = new; |
5668 | tbl->max_slots = max_slots; | 5678 | tbl->max_slots = max_slots; |
5669 | } | 5679 | } |
5670 | tbl->highest_used_slotid = -1; /* no slot is currently used */ | 5680 | tbl->highest_used_slotid = NFS4_NO_SLOT; |
5671 | for (i = 0; i < tbl->max_slots; i++) | 5681 | for (i = 0; i < tbl->max_slots; i++) |
5672 | tbl->slots[i].seq_nr = ivalue; | 5682 | tbl->slots[i].seq_nr = ivalue; |
5673 | spin_unlock(&tbl->slot_tbl_lock); | 5683 | spin_unlock(&tbl->slot_tbl_lock); |