btrfs: remove unreachable return after btrfs_backref_panic
PATCH 1/1 btrfs: remove unreachable return after btrfs_backref_panic
The return statement after btrfs_backref_panic() is unreachable since btrfs_backref_panic() calls BUG() which never returns. Removes the dead code.
Signed-off-by Zhen Ni <[email protected]>
--- fs/btrfs/backref.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
fs/btrfs/backref.c +1 -3
@@ -3609,10 +3609,8 @@ int btrfs_backref_finish_upper_links(struct btrfs_backref_cache *cache, } rb_node =rb_simple_insert (&cache->rb_root, &upper->simple_node); -if (unlikely (rb_node)) { +if (unlikely (rb_node))btrfs_backref_panic (cache->fs_info, upper->bytenr, -EEXIST ); -return -EUCLEAN ; - }list_add_tail (&edge->list[UPPER ], &upper->lower);
Signature · 1 line
2.20.1
Quoted 14 lines · Zhen Ni
The return statement after
btrfs_backref_panic()is unreachable sincebtrfs_backref_panic()callsBUG()which never returns. Removes the dead code.Signed-off-by Zhen Ni <[email protected]>--- fs/btrfs/backref.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)fs/btrfs/backref.c +0
-0
fs/btrfs/backref.c int btrfs_backref_finish_upper_links(struct btrfs_backref_cache *cache, · line 3614
Quoted 7 lines
fs/btrfs/backref.c +1
-2@@ -3609,10 +3609,8 @@ int btrfs_backref_finish_upper_links(struct btrfs_backref_cache *cache, } rb_node =rb_simple_insert (&cache->rb_root, &upper->simple_node); -if (unlikely (rb_node)) { +if (unlikely (rb_node))btrfs_backref_panic (cache->fs_info, upper->bytenr, -EEXIST ); -return -EUCLEAN ;
Ok for consistency with other calls to btrfs_backref_panic(). This would ideally be proper error handling, transaction abort etc. This code is old and the *_panic helpers were more verbose BUG(). There's a related option BTRFS_MOUNT_PANIC_ON_FATAL_ERROR.
Added to for-next, thanks.