Skip to content

Commit fab99eb

Browse files
Trond MyklebustTrond Myklebust
Trond Myklebust
authored and
Trond Myklebust
committed
NFSv4.2: Remove redundant checks in nfs_setsecurity+nfs4_label_init_security
We already check for nfs_server_capable(inode, NFS_CAP_SECURITY_LABEL) in nfs4_label_alloc() We check the minor version in _nfs4_server_capabilities before setting NFS_CAP_SECURITY_LABEL. Signed-off-by: Trond Myklebust <[email protected]>
1 parent b944dba commit fab99eb

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

fs/nfs/inode.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,6 @@ void nfs_setsecurity(struct inode *inode, struct nfs_fattr *fattr,
274274
if (label == NULL)
275275
return;
276276

277-
if (nfs_server_capable(inode, NFS_CAP_SECURITY_LABEL) == 0)
278-
return;
279-
280-
if (NFS_SERVER(inode)->nfs_client->cl_minorversion < 2)
281-
return;
282-
283277
if ((fattr->valid & NFS_ATTR_FATTR_V4_SECURITY_LABEL) && inode->i_security) {
284278
error = security_inode_notifysecctx(inode, label->label,
285279
label->len);

fs/nfs/nfs4proc.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ nfs4_label_init_security(struct inode *dir, struct dentry *dentry,
105105
if (nfs_server_capable(dir, NFS_CAP_SECURITY_LABEL) == 0)
106106
return NULL;
107107

108-
if (NFS_SERVER(dir)->nfs_client->cl_minorversion < 2)
109-
return NULL;
110-
111108
err = security_dentry_init_security(dentry, sattr->ia_mode,
112109
&dentry->d_name, (void **)&label->label, &label->len);
113110
if (err == 0)

0 commit comments

Comments
 (0)