Commit fab99ebe authored by Trond Myklebust's avatar Trond Myklebust

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: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent b944dba3
...@@ -274,12 +274,6 @@ void nfs_setsecurity(struct inode *inode, struct nfs_fattr *fattr, ...@@ -274,12 +274,6 @@ void nfs_setsecurity(struct inode *inode, struct nfs_fattr *fattr,
if (label == NULL) if (label == NULL)
return; return;
if (nfs_server_capable(inode, NFS_CAP_SECURITY_LABEL) == 0)
return;
if (NFS_SERVER(inode)->nfs_client->cl_minorversion < 2)
return;
if ((fattr->valid & NFS_ATTR_FATTR_V4_SECURITY_LABEL) && inode->i_security) { if ((fattr->valid & NFS_ATTR_FATTR_V4_SECURITY_LABEL) && inode->i_security) {
error = security_inode_notifysecctx(inode, label->label, error = security_inode_notifysecctx(inode, label->label,
label->len); label->len);
......
...@@ -105,9 +105,6 @@ nfs4_label_init_security(struct inode *dir, struct dentry *dentry, ...@@ -105,9 +105,6 @@ nfs4_label_init_security(struct inode *dir, struct dentry *dentry,
if (nfs_server_capable(dir, NFS_CAP_SECURITY_LABEL) == 0) if (nfs_server_capable(dir, NFS_CAP_SECURITY_LABEL) == 0)
return NULL; return NULL;
if (NFS_SERVER(dir)->nfs_client->cl_minorversion < 2)
return NULL;
err = security_dentry_init_security(dentry, sattr->ia_mode, err = security_dentry_init_security(dentry, sattr->ia_mode,
&dentry->d_name, (void **)&label->label, &label->len); &dentry->d_name, (void **)&label->label, &label->len);
if (err == 0) if (err == 0)
......
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