@@ -417,10 +417,19 @@ int load_free_space_cache(struct btrfs_fs_info *fs_info,
}
if (entry->type == BTRFS_FREE_SPACE_EXTENT) {
+ printk(KERN_ERR "adding extent [%llu-%llu]\n",
+ e->offset, e->bytes);
spin_lock(&block_group->tree_lock);
ret = link_free_space(block_group, e);
spin_unlock(&block_group->tree_lock);
- BUG_ON(ret);
+ if (ret) {
+ printk(KERN_ERR "Duplicate entries in
"
+ "free space cache,
dumping\n");
+ kunmap(page);
+ unlock_page(page);
+ page_cache_release(page);
+ goto free_cache;
+ }
} else {