btrfs-progs: free-space-cache: Don't panic when free space cache is corrupted
PATCH 1/1 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 <[email protected]>
Signed-off-by Qu Wenruo <[email protected]>
--- free-space-cache.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
free-space-cache.c +1 -3
@@ -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; }
Signature · 1 line
2.18.0
Quoted 7 lines · Qu Wenruo
In
btrfs_add_free_space(), if the free space to be added is already here, we triggerASSERT()which is just anotherBUG_ON().Let's remove such
BUG_ON()at all.Reported-by Lewis Diamond <[email protected]>Signed-off-by Qu Wenruo <[email protected]>
Reviewed-by Nikolay Borisov <[email protected]>
Quoted 21 lines
--- free-space-cache.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)free-space-cache.c +1
-3@@ -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; }
David Sterba
AppliedQuoted 7 lines · Qu Wenruo
In
btrfs_add_free_space(), if the free space to be added is already here, we triggerASSERT()which is just anotherBUG_ON().Let's remove such
BUG_ON()at all.Reported-by Lewis Diamond <[email protected]>Signed-off-by Qu Wenruo <[email protected]>
Applied, thanks.