btrfs-progs: free-space-cache: Don't panic when free space cache is corrupted

In btrfs_add_free_space(), if the free space to be added is already
here, we trigger ASSERT() which is just another BUG_ON().

Let's remove such BUG_ON() at all.

Reported-by: Lewis Diamond <me@lewisdiamond.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
master
Qu Wenruo 2018-07-01 10:45:26 +08:00 committed by David Sterba
parent d4f19ad084
commit 581e2c16a3
1 changed files with 1 additions and 3 deletions

View File

@ -838,10 +838,8 @@ int btrfs_add_free_space(struct btrfs_free_space_ctl *ctl, u64 offset,
try_merge_free_space(ctl, info);
ret = link_free_space(ctl, info);
if (ret) {
if (ret)
printk(KERN_CRIT "btrfs: unable to add free space :%d\n", ret);
BUG_ON(ret == -EEXIST);
}
return ret;
}