diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-01-02 15:19:18 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-01-03 09:37:17 -0500 |
commit | bb22629ee87eed5054f8b508dbe7c58abad0a324 (patch) | |
tree | 6d72f1b34fad128ad09f6a49ca42731dc74fd9c3 /fs/nfs | |
parent | 3392c34922130d1dca9ad436c358330daa85e94e (diff) |
NFSv4: nfs4_open_confirm must not set the open_owner as confirmed on error
RFC3530 states that the open_owner is confirmed if and only if the client
sends an OPEN_CONFIRM request with the appropriate sequence id and stateid
within the lease period.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4proc.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index f03d9d5f5ba4..571b5ec92132 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -741,10 +741,10 @@ static void nfs4_open_confirm_done(struct rpc_task *task, void *calldata) | |||
741 | if (data->rpc_status == 0) { | 741 | if (data->rpc_status == 0) { |
742 | memcpy(data->o_res.stateid.data, data->c_res.stateid.data, | 742 | memcpy(data->o_res.stateid.data, data->c_res.stateid.data, |
743 | sizeof(data->o_res.stateid.data)); | 743 | sizeof(data->o_res.stateid.data)); |
744 | nfs_confirm_seqid(&data->owner->so_seqid, 0); | ||
744 | renew_lease(data->o_res.server, data->timestamp); | 745 | renew_lease(data->o_res.server, data->timestamp); |
745 | data->rpc_done = 1; | 746 | data->rpc_done = 1; |
746 | } | 747 | } |
747 | nfs_confirm_seqid(&data->owner->so_seqid, data->rpc_status); | ||
748 | nfs_increment_open_seqid(data->rpc_status, data->c_arg.seqid); | 748 | nfs_increment_open_seqid(data->rpc_status, data->c_arg.seqid); |
749 | } | 749 | } |
750 | 750 | ||
@@ -759,7 +759,6 @@ static void nfs4_open_confirm_release(void *calldata) | |||
759 | /* In case of error, no cleanup! */ | 759 | /* In case of error, no cleanup! */ |
760 | if (!data->rpc_done) | 760 | if (!data->rpc_done) |
761 | goto out_free; | 761 | goto out_free; |
762 | nfs_confirm_seqid(&data->owner->so_seqid, 0); | ||
763 | state = nfs4_opendata_to_nfs4_state(data); | 762 | state = nfs4_opendata_to_nfs4_state(data); |
764 | if (!IS_ERR(state)) | 763 | if (!IS_ERR(state)) |
765 | nfs4_close_state(&data->path, state, data->o_arg.open_flags); | 764 | nfs4_close_state(&data->path, state, data->o_arg.open_flags); |
@@ -886,7 +885,6 @@ static void nfs4_open_release(void *calldata) | |||
886 | /* In case we need an open_confirm, no cleanup! */ | 885 | /* In case we need an open_confirm, no cleanup! */ |
887 | if (data->o_res.rflags & NFS4_OPEN_RESULT_CONFIRM) | 886 | if (data->o_res.rflags & NFS4_OPEN_RESULT_CONFIRM) |
888 | goto out_free; | 887 | goto out_free; |
889 | nfs_confirm_seqid(&data->owner->so_seqid, 0); | ||
890 | state = nfs4_opendata_to_nfs4_state(data); | 888 | state = nfs4_opendata_to_nfs4_state(data); |
891 | if (!IS_ERR(state)) | 889 | if (!IS_ERR(state)) |
892 | nfs4_close_state(&data->path, state, data->o_arg.open_flags); | 890 | nfs4_close_state(&data->path, state, data->o_arg.open_flags); |