]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
NFS: stop using NFS_MOUNT_SECFLAVOUR server flag
authorWeston Andros Adamson <dros@netapp.com>
Fri, 18 Oct 2013 19:15:18 +0000 (15:15 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 28 Oct 2013 19:37:56 +0000 (15:37 -0400)
Since the parsed sec= flavor is now stored in nfs_server->auth_info,
we no longer need an nfs_server flag to determine if a sec= option was
used.

This flag has not been completely removed because it is still needed for
the (old but still supported) non-text parsed mount options ABI
compatability.

Signed-off-by: Weston Andros Adamson <dros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs4client.c
fs/nfs/nfs4namespace.c
fs/nfs/nfs4proc.c
fs/nfs/super.c
include/uapi/linux/nfs_mount.h

index 04131c837f27d84daed4676201b29f3c6be03f1a..f6cc77c7d8028e11f3c418ce91fa1c59000c8dc9 100644 (file)
@@ -1051,6 +1051,7 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data,
 {
        struct nfs_client *parent_client;
        struct nfs_server *server, *parent_server;
+       bool auth_probe;
        int error;
 
        dprintk("--> nfs4_create_referral_server()\n");
@@ -1083,8 +1084,9 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data,
        if (error < 0)
                goto error;
 
-       error = nfs4_server_common_setup(server, mntfh,
-                       !(parent_server->flags & NFS_MOUNT_SECFLAVOUR));
+       auth_probe = parent_server->auth_info.flavor_len < 1;
+
+       error = nfs4_server_common_setup(server, mntfh, auth_probe);
        if (error < 0)
                goto error;
 
index 4ec0eea68fdfcd58187bc96506e35c5daff60898..b947054f0ca12ae032098cb1d5ee06890f77b2f5 100644 (file)
@@ -390,7 +390,7 @@ struct vfsmount *nfs4_submount(struct nfs_server *server, struct dentry *dentry,
 
        if (client->cl_auth->au_flavor != flavor)
                flavor = client->cl_auth->au_flavor;
-       else if (!(server->flags & NFS_MOUNT_SECFLAVOUR)) {
+       else if (server->auth_info.flavor_len == 0) {
                rpc_authflavor_t new = nfs4_negotiate_security(dir, name);
                if ((int)new >= 0)
                        flavor = new;
index 1463c71b086245c37fdbaa9b124c6a2ea1ab787f..0eb8dc5792dae457dd2cfe095b559265f7a3ddf6 100644 (file)
@@ -2920,7 +2920,7 @@ int nfs4_proc_get_rootfh(struct nfs_server *server, struct nfs_fh *fhandle,
                if (status != -NFS4ERR_WRONGSEC)
                        break;
                /* Did user force a 'sec=' mount option? */
-               if (server->flags & NFS_MOUNT_SECFLAVOUR)
+               if (server->auth_info.flavor_len > 0)
                        break;
        default:
                status = nfs4_do_find_root_sec(server, fhandle, info);
@@ -3180,7 +3180,7 @@ static int nfs4_proc_lookup_common(struct rpc_clnt **clnt, struct inode *dir,
                        if (client != *clnt)
                                goto out;
                        /* No security negotiation if the user specified 'sec=' */
-                       if (NFS_SERVER(dir)->flags & NFS_MOUNT_SECFLAVOUR)
+                       if (NFS_SERVER(dir)->auth_info.flavor_len > 0)
                                goto out;
                        client = nfs4_create_sec_client(client, dir, name);
                        if (IS_ERR(client))
index de1e5e89c93d15f47d0c8026f69f8db3a71c6207..3a4f8bf5e5a5ae3cf250e3699ad16a8b65c48ca1 100644 (file)
@@ -1067,7 +1067,6 @@ static int nfs_parse_security_flavors(char *value,
                return 0;
        }
 
-       mnt->flags |= NFS_MOUNT_SECFLAVOUR;
        mnt->auth_info.flavors[0] = pseudoflavor;
        mnt->auth_info.flavor_len = 1;
        return 1;
@@ -2332,7 +2331,7 @@ static int nfs_compare_mount_options(const struct super_block *s, const struct n
                goto Ebusy;
        if (a->acdirmax != b->acdirmax)
                goto Ebusy;
-       if (b->flags & NFS_MOUNT_SECFLAVOUR &&
+       if (b->auth_info.flavor_len > 0 &&
           clnt_a->cl_auth->au_flavor != clnt_b->cl_auth->au_flavor)
                goto Ebusy;
        return 1;
index 576bddd72e0402b6020208da922c2837b321bb49..64b0f22f5c4c6ae96612adf41ed2414751c2315a 100644 (file)
@@ -60,7 +60,7 @@ struct nfs_mount_data {
 #define NFS_MOUNT_BROKEN_SUID  0x0400  /* 4 */
 #define NFS_MOUNT_NOACL                0x0800  /* 4 */
 #define NFS_MOUNT_STRICTLOCK   0x1000  /* reserved for NFSv4 */
-#define NFS_MOUNT_SECFLAVOUR   0x2000  /* 5 */
+#define NFS_MOUNT_SECFLAVOUR   0x2000  /* 5 non-text parsed mount data only */
 #define NFS_MOUNT_NORDIRPLUS   0x4000  /* 5 */
 #define NFS_MOUNT_UNSHARED     0x8000  /* 5 */
 #define NFS_MOUNT_FLAGMASK     0xFFFF