Commit 3b66486c authored by Trond Myklebust's avatar Trond Myklebust

NFSv4.1: Select the "most recent locking state" for read/write/setattr stateids

Follow the practice described in section 8.2.2 of RFC5661: When sending a
read/write or setattr stateid, set the seqid field to zero in order to
signal that the NFS server should apply the most recent locking state.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 39c6daae
...@@ -6841,7 +6841,8 @@ static const struct nfs4_minor_version_ops nfs_v4_1_minor_ops = { ...@@ -6841,7 +6841,8 @@ static const struct nfs4_minor_version_ops nfs_v4_1_minor_ops = {
.init_caps = NFS_CAP_READDIRPLUS .init_caps = NFS_CAP_READDIRPLUS
| NFS_CAP_ATOMIC_OPEN | NFS_CAP_ATOMIC_OPEN
| NFS_CAP_CHANGE_ATTR | NFS_CAP_CHANGE_ATTR
| NFS_CAP_POSIX_LOCK, | NFS_CAP_POSIX_LOCK
| NFS_CAP_STATEID_NFSV41,
.call_sync = nfs4_call_sync_sequence, .call_sync = nfs4_call_sync_sequence,
.match_stateid = nfs41_match_stateid, .match_stateid = nfs41_match_stateid,
.find_root_sec = nfs41_find_root_sec, .find_root_sec = nfs41_find_root_sec,
......
...@@ -1053,6 +1053,8 @@ int nfs4_select_rw_stateid(nfs4_stateid *dst, struct nfs4_state *state, ...@@ -1053,6 +1053,8 @@ int nfs4_select_rw_stateid(nfs4_stateid *dst, struct nfs4_state *state,
goto out; goto out;
ret = nfs4_copy_open_stateid(dst, state); ret = nfs4_copy_open_stateid(dst, state);
out: out:
if (nfs_server_capable(state->inode, NFS_CAP_STATEID_NFSV41))
dst->seqid = 0;
return ret; return ret;
} }
......
...@@ -197,5 +197,6 @@ struct nfs_server { ...@@ -197,5 +197,6 @@ struct nfs_server {
#define NFS_CAP_MTIME (1U << 13) #define NFS_CAP_MTIME (1U << 13)
#define NFS_CAP_POSIX_LOCK (1U << 14) #define NFS_CAP_POSIX_LOCK (1U << 14)
#define NFS_CAP_UIDGID_NOMAP (1U << 15) #define NFS_CAP_UIDGID_NOMAP (1U << 15)
#define NFS_CAP_STATEID_NFSV41 (1U << 16)
#endif #endif
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