btrfs: Remove spurious BUG_ON in btrfs_get_extent
diff mbox series

Message ID 20200803094318.776-1-nborisov@suse.com
State New
Headers show
Series
  • btrfs: Remove spurious BUG_ON in btrfs_get_extent
Related show

Commit Message

Nikolay Borisov Aug. 3, 2020, 9:43 a.m. UTC
That BUG_ON cannot ever trigger because as the comment there states -
'err' is always set. Simply remove it as it brings no value.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/inode.c | 1 -
 1 file changed, 1 deletion(-)

Comments

David Sterba Aug. 11, 2020, 1:53 p.m. UTC | #1
On Mon, Aug 03, 2020 at 12:43:18PM +0300, Nikolay Borisov wrote:
> That BUG_ON cannot ever trigger because as the comment there states -
> 'err' is always set. Simply remove it as it brings no value.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

Added to misc-next, thanks.

Patch
diff mbox series

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 14aed0d3cb51..0df881e39f57 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -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;
 }