diff options
author | Kinglong Mee <kinglongmee@gmail.com> | 2015-07-30 09:55:02 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2015-08-31 16:16:39 -0400 |
commit | ead8fb8c24411722b92198b3dccd102a76cdd050 (patch) | |
tree | 5f741c274eac984860fff4fe32955d86eb7b2cb3 /fs/nfsd | |
parent | 7d580722c9f353d19e255f929d341caa821060d6 (diff) |
NFSD: Set the attributes used to store the verifier for EXCLUSIVE4_1
According to rfc5661 18.16.4,
"If EXCLUSIVE4_1 was used, the client determines the attributes
used for the verifier by comparing attrset with cva_attrs.attrmask;"
So, EXCLUSIVE4_1 also needs those bitmask used to store the verifier.
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 12 | ||||
-rw-r--r-- | fs/nfsd/vfs.c | 6 | ||||
-rw-r--r-- | fs/nfsd/vfs.h | 6 |
3 files changed, 12 insertions, 12 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index b9681ee0ed19..4ce6b97b31ad 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -276,13 +276,13 @@ do_open_lookup(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, stru | |||
276 | nfsd4_security_inode_setsecctx(*resfh, &open->op_label, open->op_bmval); | 276 | nfsd4_security_inode_setsecctx(*resfh, &open->op_label, open->op_bmval); |
277 | 277 | ||
278 | /* | 278 | /* |
279 | * Following rfc 3530 14.2.16, use the returned bitmask | 279 | * Following rfc 3530 14.2.16, and rfc 5661 18.16.4 |
280 | * to indicate which attributes we used to store the | 280 | * use the returned bitmask to indicate which attributes |
281 | * verifier: | 281 | * we used to store the verifier: |
282 | */ | 282 | */ |
283 | if (open->op_createmode == NFS4_CREATE_EXCLUSIVE && status == 0) | 283 | if (nfsd_create_is_exclusive(open->op_createmode) && status == 0) |
284 | open->op_bmval[1] = (FATTR4_WORD1_TIME_ACCESS | | 284 | open->op_bmval[1] |= (FATTR4_WORD1_TIME_ACCESS | |
285 | FATTR4_WORD1_TIME_MODIFY); | 285 | FATTR4_WORD1_TIME_MODIFY); |
286 | } else | 286 | } else |
287 | /* | 287 | /* |
288 | * Note this may exit with the parent still locked. | 288 | * Note this may exit with the parent still locked. |
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index b5e077a6e7d4..45c04979e7b3 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -1249,12 +1249,6 @@ out_nfserr: | |||
1249 | 1249 | ||
1250 | #ifdef CONFIG_NFSD_V3 | 1250 | #ifdef CONFIG_NFSD_V3 |
1251 | 1251 | ||
1252 | static inline int nfsd_create_is_exclusive(int createmode) | ||
1253 | { | ||
1254 | return createmode == NFS3_CREATE_EXCLUSIVE | ||
1255 | || createmode == NFS4_CREATE_EXCLUSIVE4_1; | ||
1256 | } | ||
1257 | |||
1258 | /* | 1252 | /* |
1259 | * NFSv3 and NFSv4 version of nfsd_create | 1253 | * NFSv3 and NFSv4 version of nfsd_create |
1260 | */ | 1254 | */ |
diff --git a/fs/nfsd/vfs.h b/fs/nfsd/vfs.h index 5be875e3e638..fee2451ae248 100644 --- a/fs/nfsd/vfs.h +++ b/fs/nfsd/vfs.h | |||
@@ -131,4 +131,10 @@ static inline __be32 fh_getattr(struct svc_fh *fh, struct kstat *stat) | |||
131 | return nfserrno(vfs_getattr(&p, stat)); | 131 | return nfserrno(vfs_getattr(&p, stat)); |
132 | } | 132 | } |
133 | 133 | ||
134 | static inline int nfsd_create_is_exclusive(int createmode) | ||
135 | { | ||
136 | return createmode == NFS3_CREATE_EXCLUSIVE | ||
137 | || createmode == NFS4_CREATE_EXCLUSIVE4_1; | ||
138 | } | ||
139 | |||
134 | #endif /* LINUX_NFSD_VFS_H */ | 140 | #endif /* LINUX_NFSD_VFS_H */ |