]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
NFSv4.2: Remove redundant checks in nfs_setsecurity+nfs4_label_init_security
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 4 Nov 2013 18:46:40 +0000 (13:46 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 4 Nov 2013 21:42:52 +0000 (16:42 -0500)
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 <Trond.Myklebust@netapp.com>
fs/nfs/inode.c
fs/nfs/nfs4proc.c

index 26e77d81234ee0c2dfa314574de5cf8a459be453..18ab2da4eeb65dbf7c8f7d7b578a35fc5251b0b6 100644 (file)
@@ -274,12 +274,6 @@ void nfs_setsecurity(struct inode *inode, struct nfs_fattr *fattr,
        if (label == NULL)
                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) {
                error = security_inode_notifysecctx(inode, label->label,
                                label->len);
index ed2a0e6b9aed35ed2003d2547cb665e4049378ba..5ab33c0792dfc208d9cdb51e0a0208d77ba22712 100644 (file)
@@ -105,9 +105,6 @@ nfs4_label_init_security(struct inode *dir, struct dentry *dentry,
        if (nfs_server_capable(dir, NFS_CAP_SECURITY_LABEL) == 0)
                return NULL;
 
-       if (NFS_SERVER(dir)->nfs_client->cl_minorversion < 2)
-               return NULL;
-
        err = security_dentry_init_security(dentry, sattr->ia_mode,
                                &dentry->d_name, (void **)&label->label, &label->len);
        if (err == 0)