mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
Merge branch 'fst-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus-4.9
Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
commit
d9ed71e545
8 changed files with 272 additions and 157 deletions
|
@ -2586,6 +2586,7 @@ int open_ctree(struct super_block *sb,
|
|||
int num_backups_tried = 0;
|
||||
int backup_index = 0;
|
||||
int max_active;
|
||||
int clear_free_space_tree = 0;
|
||||
|
||||
tree_root = fs_info->tree_root = btrfs_alloc_root(fs_info, GFP_KERNEL);
|
||||
chunk_root = fs_info->chunk_root = btrfs_alloc_root(fs_info, GFP_KERNEL);
|
||||
|
@ -3148,6 +3149,26 @@ retry_root_backup:
|
|||
if (sb->s_flags & MS_RDONLY)
|
||||
return 0;
|
||||
|
||||
if (btrfs_test_opt(fs_info, CLEAR_CACHE) &&
|
||||
btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE)) {
|
||||
clear_free_space_tree = 1;
|
||||
} else if (btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE) &&
|
||||
!btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE_VALID)) {
|
||||
btrfs_warn(fs_info, "free space tree is invalid");
|
||||
clear_free_space_tree = 1;
|
||||
}
|
||||
|
||||
if (clear_free_space_tree) {
|
||||
btrfs_info(fs_info, "clearing free space tree");
|
||||
ret = btrfs_clear_free_space_tree(fs_info);
|
||||
if (ret) {
|
||||
btrfs_warn(fs_info,
|
||||
"failed to clear free space tree: %d", ret);
|
||||
close_ctree(tree_root);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (btrfs_test_opt(tree_root->fs_info, FREE_SPACE_TREE) &&
|
||||
!btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE)) {
|
||||
btrfs_info(fs_info, "creating free space tree");
|
||||
|
@ -3185,18 +3206,6 @@ retry_root_backup:
|
|||
|
||||
btrfs_qgroup_rescan_resume(fs_info);
|
||||
|
||||
if (btrfs_test_opt(tree_root->fs_info, CLEAR_CACHE) &&
|
||||
btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE)) {
|
||||
btrfs_info(fs_info, "clearing free space tree");
|
||||
ret = btrfs_clear_free_space_tree(fs_info);
|
||||
if (ret) {
|
||||
btrfs_warn(fs_info,
|
||||
"failed to clear free space tree: %d", ret);
|
||||
close_ctree(tree_root);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (!fs_info->uuid_root) {
|
||||
btrfs_info(fs_info, "creating UUID tree");
|
||||
ret = btrfs_create_uuid_tree(fs_info);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue