Skip to content

Commit

Permalink
btrfs: merge free_fs_info() calls on fill_super failures
Browse files Browse the repository at this point in the history
... all the way up into btrfs_mount().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Jan 9, 2012
1 parent 29db78a commit be7e095
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2427,7 +2427,6 @@ int open_ctree(struct super_block *sb,
up_read(&fs_info->cleanup_work_sem);
if (err) {
close_ctree(tree_root);
free_fs_info(fs_info);
return err;
}
}
Expand Down Expand Up @@ -2478,7 +2477,6 @@ int open_ctree(struct super_block *sb,
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:
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit be7e095

Please sign in to comment.