goto error;
}
+ /* Insert extent in reada tree + all per-device trees, all or nothing */
+ btrfs_dev_replace_read_lock(&fs_info->dev_replace);
ret = radix_tree_preload(GFP_KERNEL);
- if (ret)
+ if (ret) {
+ btrfs_dev_replace_read_unlock(&fs_info->dev_replace);
goto error;
+ }
- /* insert extent in reada_tree + all per-device trees, all or nothing */
- btrfs_dev_replace_read_lock(&fs_info->dev_replace);
spin_lock(&fs_info->reada_lock);
ret = radix_tree_insert(&fs_info->reada_tree, index, re);
if (ret == -EEXIST) {
re_exist = radix_tree_lookup(&fs_info->reada_tree, index);
re_exist->refcnt++;
spin_unlock(&fs_info->reada_lock);
- btrfs_dev_replace_read_unlock(&fs_info->dev_replace);
radix_tree_preload_end();
+ btrfs_dev_replace_read_unlock(&fs_info->dev_replace);
goto error;
}
if (ret) {
spin_unlock(&fs_info->reada_lock);
- btrfs_dev_replace_read_unlock(&fs_info->dev_replace);
radix_tree_preload_end();
+ btrfs_dev_replace_read_unlock(&fs_info->dev_replace);
goto error;
}
radix_tree_preload_end();