]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
btrfs: merge free_fs_info() calls on fill_super failures
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 17 Nov 2011 06:40:05 +0000 (01:40 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 9 Jan 2012 00:34:40 +0000 (19:34 -0500)
... all the way up into btrfs_mount().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/btrfs/disk-io.c
fs/btrfs/super.c

index 78247522c6934657fb346984ebff9a34e0abeb12..b6d11eb4e430d9880381fc562ea1c34bd30c2ba1 100644 (file)
@@ -2427,7 +2427,6 @@ retry_root_backup:
                up_read(&fs_info->cleanup_work_sem);
                if (err) {
                        close_ctree(tree_root);
-                       free_fs_info(fs_info);
                        return err;
                }
        }
@@ -2478,7 +2477,6 @@ fail_srcu:
        cleanup_srcu_struct(&fs_info->subvol_srcu);
 fail:
        btrfs_close_devices(fs_info->fs_devices);
-       free_fs_info(fs_info);
        return err;
 
 recovery_tree_root:
index a381f9f9b0c2d58543744f80f21a1d8eb6e5a361..8901b6c85260dfc84c03595bb9f1034308a1f521 100644 (file)
@@ -634,7 +634,6 @@ static int btrfs_fill_super(struct super_block *sb,
 
 fail_close:
        close_ctree(tree_root);
-       free_fs_info(fs_info);
        return err;
 }
 
@@ -947,6 +946,7 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
                error = btrfs_fill_super(s, fs_devices, data,
                                         flags & MS_SILENT ? 1 : 0);
                if (error) {
+                       free_fs_info(fs_info);
                        deactivate_locked_super(s);
                        return ERR_PTR(error);
                }