aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/disk-io.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 54bc8c7c6bcd..c0bfc6ce5f06 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3129,6 +3129,18 @@ retry_root_backup:
3129 if (sb->s_flags & MS_RDONLY) 3129 if (sb->s_flags & MS_RDONLY)
3130 return 0; 3130 return 0;
3131 3131
3132 if (btrfs_test_opt(fs_info, CLEAR_CACHE) &&
3133 btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE)) {
3134 btrfs_info(fs_info, "clearing free space tree");
3135 ret = btrfs_clear_free_space_tree(fs_info);
3136 if (ret) {
3137 btrfs_warn(fs_info,
3138 "failed to clear free space tree: %d", ret);
3139 close_ctree(tree_root);
3140 return ret;
3141 }
3142 }
3143
3132 if (btrfs_test_opt(tree_root->fs_info, FREE_SPACE_TREE) && 3144 if (btrfs_test_opt(tree_root->fs_info, FREE_SPACE_TREE) &&
3133 !btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE)) { 3145 !btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE)) {
3134 btrfs_info(fs_info, "creating free space tree"); 3146 btrfs_info(fs_info, "creating free space tree");
@@ -3166,18 +3178,6 @@ retry_root_backup:
3166 3178
3167 btrfs_qgroup_rescan_resume(fs_info); 3179 btrfs_qgroup_rescan_resume(fs_info);
3168 3180
3169 if (btrfs_test_opt(tree_root->fs_info, CLEAR_CACHE) &&
3170 btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE)) {
3171 btrfs_info(fs_info, "clearing free space tree");
3172 ret = btrfs_clear_free_space_tree(fs_info);
3173 if (ret) {
3174 btrfs_warn(fs_info,
3175 "failed to clear free space tree: %d", ret);
3176 close_ctree(tree_root);
3177 return ret;
3178 }
3179 }
3180
3181 if (!fs_info->uuid_root) { 3181 if (!fs_info->uuid_root) {
3182 btrfs_info(fs_info, "creating UUID tree"); 3182 btrfs_info(fs_info, "creating UUID tree");
3183 ret = btrfs_create_uuid_tree(fs_info); 3183 ret = btrfs_create_uuid_tree(fs_info);