aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-03-17 15:31:15 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-03-25 12:04:11 -0400
commit3b66486c4c7136f8d4bbe1306d581fadc6bce4c7 (patch)
tree953049d16122695bab4388ae86394bb2d09bb236
parent39c6daae70fe7692fc2d28738c7ebd63f0318741 (diff)
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: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/nfs4proc.c3
-rw-r--r--fs/nfs/nfs4state.c2
-rw-r--r--include/linux/nfs_fs_sb.h1
3 files changed, 5 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 22c80f9ed824..625a729ebcca 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -6841,7 +6841,8 @@ static const struct nfs4_minor_version_ops nfs_v4_1_minor_ops = {
6841 .init_caps = NFS_CAP_READDIRPLUS 6841 .init_caps = NFS_CAP_READDIRPLUS
6842 | NFS_CAP_ATOMIC_OPEN 6842 | NFS_CAP_ATOMIC_OPEN
6843 | NFS_CAP_CHANGE_ATTR 6843 | NFS_CAP_CHANGE_ATTR
6844 | NFS_CAP_POSIX_LOCK, 6844 | NFS_CAP_POSIX_LOCK
6845 | NFS_CAP_STATEID_NFSV41,
6845 .call_sync = nfs4_call_sync_sequence, 6846 .call_sync = nfs4_call_sync_sequence,
6846 .match_stateid = nfs41_match_stateid, 6847 .match_stateid = nfs41_match_stateid,
6847 .find_root_sec = nfs41_find_root_sec, 6848 .find_root_sec = nfs41_find_root_sec,
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 4e95bd72f480..685b1e953ed8 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1053,6 +1053,8 @@ int nfs4_select_rw_stateid(nfs4_stateid *dst, struct nfs4_state *state,
1053 goto out; 1053 goto out;
1054 ret = nfs4_copy_open_stateid(dst, state); 1054 ret = nfs4_copy_open_stateid(dst, state);
1055out: 1055out:
1056 if (nfs_server_capable(state->inode, NFS_CAP_STATEID_NFSV41))
1057 dst->seqid = 0;
1056 return ret; 1058 return ret;
1057} 1059}
1058 1060
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 6c6ed153a9b4..74c9e52c9338 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -197,5 +197,6 @@ struct nfs_server {
197#define NFS_CAP_MTIME (1U << 13) 197#define NFS_CAP_MTIME (1U << 13)
198#define NFS_CAP_POSIX_LOCK (1U << 14) 198#define NFS_CAP_POSIX_LOCK (1U << 14)
199#define NFS_CAP_UIDGID_NOMAP (1U << 15) 199#define NFS_CAP_UIDGID_NOMAP (1U << 15)
200#define NFS_CAP_STATEID_NFSV41 (1U << 16)
200 201
201#endif 202#endif