Btrfs: convert BUG_ON to WARN_ON
authorLiu Bo <bo.li.liu@oracle.com>
Tue, 14 Mar 2017 20:34:01 +0000 (13:34 -0700)
committerDavid Sterba <dsterba@suse.com>
Tue, 18 Apr 2017 12:07:25 +0000 (14:07 +0200)
These two BUG_ON()s would never be true, ensured by callers' logic.

Reviewed-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c

index 259bd2120da5a2b537f11554208ecee307f5a54f..13574f37dc364475d16fe9512ad2f628903cb165 100644 (file)
@@ -5174,7 +5174,7 @@ unsigned long btrfs_full_stripe_len(struct btrfs_fs_info *fs_info,
        unsigned long len = fs_info->sectorsize;
 
        em = get_chunk_map(fs_info, logical, len);
-       BUG_ON(IS_ERR(em));
+       WARN_ON(IS_ERR(em));
 
        map = em->map_lookup;
        if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK)
@@ -5191,7 +5191,7 @@ int btrfs_is_parity_mirror(struct btrfs_fs_info *fs_info,
        int ret = 0;
 
        em = get_chunk_map(fs_info, logical, len);
-       BUG_ON(IS_ERR(em));
+       WARN_ON(IS_ERR(em));
 
        map = em->map_lookup;
        if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK)