Commit 34dc1ad7 authored by Benny Halevy's avatar Benny Halevy

nfs41: increment_{open,lock}_seqid

Unlike minorversion0, in nfsv4.1 the open and lock seqids need
not be incremented by the client and should always be set to zero.

This is implemented using a new nfs_rpc_ops methods -
increment_open_seqid and increment_lock_seqid
Signed-off-by: default avatarRahul Iyer <iyer@netapp.com>
Signed-off-by: default avatarBenny Halevy <bhalevy@panasas.com>
[nfs41: check for session not minorversion]
Signed-off-by: default avatarAndy Adamson <andros@netapp.com>
Signed-off-by: default avatarBenny Halevy <bhalevy@panasas.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 78722e9c
...@@ -1808,6 +1808,8 @@ int nfs4_do_close(struct path *path, struct nfs4_state *state, int wait) ...@@ -1808,6 +1808,8 @@ int nfs4_do_close(struct path *path, struct nfs4_state *state, int wait)
calldata->state = state; calldata->state = state;
calldata->arg.fh = NFS_FH(state->inode); calldata->arg.fh = NFS_FH(state->inode);
calldata->arg.stateid = &state->open_stateid; calldata->arg.stateid = &state->open_stateid;
if (nfs4_has_session(server->nfs_client))
memset(calldata->arg.stateid->data, 0, 4); /* clear seqid */
/* Serialization for the sequence id */ /* Serialization for the sequence id */
calldata->arg.seqid = nfs_alloc_seqid(&state->owner->so_seqid); calldata->arg.seqid = nfs_alloc_seqid(&state->owner->so_seqid);
if (calldata->arg.seqid == NULL) if (calldata->arg.seqid == NULL)
......
...@@ -742,11 +742,13 @@ static void nfs_increment_seqid(int status, struct nfs_seqid *seqid) ...@@ -742,11 +742,13 @@ static void nfs_increment_seqid(int status, struct nfs_seqid *seqid)
void nfs_increment_open_seqid(int status, struct nfs_seqid *seqid) void nfs_increment_open_seqid(int status, struct nfs_seqid *seqid)
{ {
if (status == -NFS4ERR_BAD_SEQID) {
struct nfs4_state_owner *sp = container_of(seqid->sequence, struct nfs4_state_owner *sp = container_of(seqid->sequence,
struct nfs4_state_owner, so_seqid); struct nfs4_state_owner, so_seqid);
struct nfs_server *server = sp->so_server;
if (status == -NFS4ERR_BAD_SEQID)
nfs4_drop_state_owner(sp); nfs4_drop_state_owner(sp);
} if (!nfs4_has_session(server->nfs_client))
nfs_increment_seqid(status, seqid); nfs_increment_seqid(status, seqid);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment