Skip to content

Commit ad3cbbb

Browse files
committed
NFSD: Clear TIME_DELEG in the suppattr_exclcreat bitmap
>From RFC 8881: 5.8.1.14. Attribute 75: suppattr_exclcreat > The bit vector that would set all REQUIRED and RECOMMENDED > attributes that are supported by the EXCLUSIVE4_1 method of file > creation via the OPEN operation. The scope of this attribute > applies to all objects with a matching fsid. There's nothing in RFC 8881 that states that suppattr_exclcreat is or is not allowed to contain bits for attributes that are clear in the reported supported_attrs bitmask. But it doesn't make sense for an NFS server to indicate that it /doesn't/ implement an attribute, but then also indicate that clients /are/ allowed to set that attribute using OPEN(create) with EXCLUSIVE4_1. The FATTR4_WORD2_TIME_DELEG attributes are also not to be allowed for OPEN(create) with EXCLUSIVE4_1. It doesn't make sense to set a delegated timestamp on a new file. Fixes: 7e13f4f ("nfsd: handle delegated timestamps in SETATTR") Cc: stable@vger.kernel.org Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 27d1764 commit ad3cbbb

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

fs/nfsd/nfsd.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,14 @@ static inline bool nfsd_attrs_supported(u32 minorversion, const u32 *bmval)
547547
#define NFSD_SUPPATTR_EXCLCREAT_WORD1 \
548548
(NFSD_WRITEABLE_ATTRS_WORD1 & \
549549
~(FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET))
550+
/*
551+
* The FATTR4_WORD2_TIME_DELEG attributes are not to be allowed for
552+
* OPEN(create) with EXCLUSIVE4_1. It doesn't make sense to set a
553+
* delegated timestamp on a new file.
554+
*/
550555
#define NFSD_SUPPATTR_EXCLCREAT_WORD2 \
551-
NFSD_WRITEABLE_ATTRS_WORD2
556+
(NFSD_WRITEABLE_ATTRS_WORD2 & \
557+
~(FATTR4_WORD2_TIME_DELEG_ACCESS | FATTR4_WORD2_TIME_DELEG_MODIFY))
552558

553559
extern int nfsd4_is_junction(struct dentry *dentry);
554560
extern int register_cld_notifier(void);

0 commit comments

Comments
 (0)