]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/super.c
f2fs: fix to dirty inode for i_mode recovery
[linux.git] / fs / super.c
index 1f75fe3125977089db8f1416f3a3fa6fda6f1b46..48e25eba846533dc0ae6b213e522d8bf52254087 100644 (file)
@@ -1247,12 +1247,10 @@ mount_fs(struct file_system_type *type, int flags, const char *name, void *data)
        struct dentry *root;
        struct super_block *sb;
        int error = -ENOMEM;
-       struct security_mnt_opts opts;
-
-       security_init_mnt_opts(&opts);
+       void *sec_opts = NULL;
 
        if (data && !(type->fs_flags & FS_BINARY_MOUNTDATA)) {
-               error = security_sb_eat_lsm_opts(data, &opts);
+               error = security_sb_eat_lsm_opts(data, &sec_opts);
                if (error)
                        return ERR_PTR(error);
        }
@@ -1275,11 +1273,11 @@ mount_fs(struct file_system_type *type, int flags, const char *name, void *data)
        smp_wmb();
        sb->s_flags |= SB_BORN;
 
-       error = security_sb_set_mnt_opts(sb, &opts, 0, NULL);
+       error = security_sb_set_mnt_opts(sb, sec_opts, 0, NULL);
        if (error)
                goto out_sb;
 
-       if (!(flags & MS_KERNMOUNT)) {
+       if (!(flags & (MS_KERNMOUNT|MS_SUBMOUNT))) {
                error = security_sb_kern_mount(sb);
                if (error)
                        goto out_sb;
@@ -1295,13 +1293,13 @@ mount_fs(struct file_system_type *type, int flags, const char *name, void *data)
                "negative value (%lld)\n", type->name, sb->s_maxbytes);
 
        up_write(&sb->s_umount);
-       security_free_mnt_opts(&opts);
+       security_free_mnt_opts(&sec_opts);
        return root;
 out_sb:
        dput(root);
        deactivate_locked_super(sb);
 out_free_secdata:
-       security_free_mnt_opts(&opts);
+       security_free_mnt_opts(&sec_opts);
        return ERR_PTR(error);
 }