]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
vfs: subtype handling moved to fuse
authorDavid Howells <dhowells@redhat.com>
Mon, 25 Mar 2019 16:38:31 +0000 (16:38 +0000)
committerMiklos Szeredi <mszeredi@redhat.com>
Fri, 6 Sep 2019 19:28:49 +0000 (21:28 +0200)
The unused vfs code can be removed.  Don't pass empty subtype (same as if
->parse callback isn't called).

The bits that are left involve determining whether it's permitted to split the
filesystem type string passed in to mount(2).  Consequently, this means that we
cannot get rid of the FS_HAS_SUBTYPE flag unless we define that a type string
with a dot in it always indicates a subtype specification.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fs_context.c
fs/fuse/inode.c
fs/namespace.c
fs/proc_namespace.c
fs/super.c
include/linux/fs_context.h

index 87c2c9687d90390d5dcfe2ef68fac078a90a6112..138b5b4d621d2e86527a2116a2688b07eb11d3cb 100644 (file)
@@ -504,7 +504,6 @@ void put_fs_context(struct fs_context *fc)
        put_net(fc->net_ns);
        put_user_ns(fc->user_ns);
        put_cred(fc->cred);
-       kfree(fc->subtype);
        put_fc_log(fc);
        put_filesystem(fc->fs_type);
        kfree(fc->source);
@@ -571,17 +570,6 @@ static int legacy_parse_param(struct fs_context *fc, struct fs_parameter *param)
                return 0;
        }
 
-       if ((fc->fs_type->fs_flags & FS_HAS_SUBTYPE) &&
-           strcmp(param->key, "subtype") == 0) {
-               if (param->type != fs_value_is_string)
-                       return invalf(fc, "VFS: Legacy: Non-string subtype");
-               if (fc->subtype)
-                       return invalf(fc, "VFS: Legacy: Multiple subtype");
-               fc->subtype = param->string;
-               param->string = NULL;
-               return 0;
-       }
-
        if (ctx->param_type == LEGACY_FS_MONOLITHIC_PARAMS)
                return invalf(fc, "VFS: Legacy: Can't mix monolithic and individual options");
 
@@ -738,8 +726,6 @@ void vfs_clean_context(struct fs_context *fc)
        fc->s_fs_info = NULL;
        fc->sb_flags = 0;
        security_free_mnt_opts(&fc->security);
-       kfree(fc->subtype);
-       fc->subtype = NULL;
        kfree(fc->source);
        fc->source = NULL;
 
index c334f95e799a36260c3fd4bc44039e76bf4a8ad3..2183967261a465817770e48ece5d2587de5d920b 100644 (file)
@@ -473,8 +473,7 @@ static const struct fs_parameter_spec fuse_param_specs[] = {
        fsparam_flag    ("allow_other",         OPT_ALLOW_OTHER),
        fsparam_u32     ("max_read",            OPT_MAX_READ),
        fsparam_u32     ("blksize",             OPT_BLKSIZE),
-       __fsparam(fs_param_is_string, "subtype", OPT_SUBTYPE,
-                 fs_param_v_optional),
+       fsparam_string  ("subtype",             OPT_SUBTYPE),
        {}
 };
 
index d28d30b1304397eac7c92a4be3f60e02a9a536d7..105f995543f6aa1587389b394d0dbf56bdfed19a 100644 (file)
@@ -2768,8 +2768,6 @@ static int do_new_mount(struct path *path, const char *fstype, int sb_flags,
                                put_filesystem(type);
                                return -EINVAL;
                        }
-               } else {
-                       subtype = "";
                }
        }
 
index e16fb8f2049e76dafdd533158fa534dc321d6dbc..273ee82d8aa97d8f83bfbfc986f1e8b1c65d640a 100644 (file)
@@ -88,7 +88,7 @@ static inline void mangle(struct seq_file *m, const char *s)
 static void show_type(struct seq_file *m, struct super_block *sb)
 {
        mangle(m, sb->s_type->name);
-       if (sb->s_subtype && sb->s_subtype[0]) {
+       if (sb->s_subtype) {
                seq_putc(m, '.');
                mangle(m, sb->s_subtype);
        }
index da223b4cfbcaf0a0689d9f7c7a77c280c28e3bd6..a6ceed7bcd8956f4275b09e3ca18411f48915128 100644 (file)
@@ -1530,11 +1530,6 @@ int vfs_get_tree(struct fs_context *fc)
        sb = fc->root->d_sb;
        WARN_ON(!sb->s_bdi);
 
-       if (fc->subtype && !sb->s_subtype) {
-               sb->s_subtype = fc->subtype;
-               fc->subtype = NULL;
-       }
-
        /*
         * Write barrier is for super_cache_count(). We place it before setting
         * SB_BORN as the data dependency between the two functions is the
index 84a5eaa09f19638c47d24876e6e8d3f285a4477a..f6c86d58ea91303c363773d677efb3d8adb7d641 100644 (file)
@@ -95,7 +95,6 @@ struct fs_context {
        const struct cred       *cred;          /* The mounter's credentials */
        struct fc_log           *log;           /* Logging buffer */
        const char              *source;        /* The source name (eg. dev path) */
-       const char              *subtype;       /* The subtype to set on the superblock */
        void                    *security;      /* Linux S&M options */
        void                    *s_fs_info;     /* Proposed s_fs_info */
        unsigned int            sb_flags;       /* Proposed superblock flags (SB_*) */