Skip to contentSkip to conversation

btrfs: Remove spurious BUG_ON in btrfs_get_extent

PATCH In review Nikolay Borisov 2 participants 2 messages Aug 3, 2020 – Aug 11, 2020 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: Remove spurious BUG_ON in btrfs_get_extent

That BUG_ON cannot ever trigger because as the comment there states - 'err' is always set. Simply remove it as it brings no value.

---
 fs/btrfs/inode.c | 1 -
 1 file changed, 1 deletion(-)
fs/btrfs/inode.c +0 -1
index 14aed0d3cb51..0df881e39f57 100644
@@ -6740,7 +6740,6 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode,
 		free_extent_map(em);
 		return ERR_PTR(err);
 	}
-	BUG_ON(!em); /* Error is always set */
 	return em;
 }
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 4 lines · Nikolay Borisov

That BUG_ON cannot ever trigger because as the comment there states - 'err' is always set. Simply remove it as it brings no value.

Added to misc-next, thanks.