NFSv4: Remove unnecessary 'minor version' check
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 5 Nov 2021 17:40:11 +0000 (13:40 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 5 Nov 2021 18:54:30 +0000 (14:54 -0400)
It is completely redundant to the server capability check.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/inode.c

index b81b2d2f47adec34be51aded7ecc2369a7f68987..b4cb75c45f90cf021f2ff68774ed5f11f722b996 100644 (file)
@@ -378,14 +378,10 @@ void nfs_setsecurity(struct inode *inode, struct nfs_fattr *fattr,
 
 struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags)
 {
-       struct nfs4_label *label = NULL;
-       int minor_version = server->nfs_client->cl_minorversion;
-
-       if (minor_version < 2)
-               return label;
+       struct nfs4_label *label;
 
        if (!(server->caps & NFS_CAP_SECURITY_LABEL))
-               return label;
+               return NULL;
 
        label = kzalloc(sizeof(struct nfs4_label), flags);
        if (label == NULL)