btrfs: preparation to fixing mount/umount race
We need fs_info and root to live until the moment when the victim superblock leaves the list, so we need to postpone free_fs_info() until after ->put_super(). The call is buried in close_ctree(), though, so we need to lift it into the callers (including btrfs_put_super()) first. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -2424,6 +2424,7 @@ retry_root_backup:
|
||||
up_read(&fs_info->cleanup_work_sem);
|
||||
if (err) {
|
||||
close_ctree(tree_root);
|
||||
free_fs_info(fs_info);
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
}
|
||||
@@ -3059,8 +3060,6 @@ int close_ctree(struct btrfs_root *root)
|
||||
bdi_destroy(&fs_info->bdi);
|
||||
cleanup_srcu_struct(&fs_info->subvol_srcu);
|
||||
|
||||
free_fs_info(fs_info);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user