btrfs: stop checking for NULL return from btrfs_get_extent_fiemap()
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Fri, 4 Feb 2022 12:06:27 +0000 (04:06 -0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 14 Mar 2022 12:13:49 +0000 (13:13 +0100)
In get_extent_skip_holes() we're checking the return of
btrfs_get_extent_fiemap() for an error pointer or NULL, but
btrfs_get_extent_fiemap() will never return NULL, only error pointers or
a valid extent_map.

The other caller of btrfs_get_extent_fiemap(), find_desired_extent(),
correctly only checks for error-pointers.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c

index 4c91060d103aee5e36a7987f6663cfcaff4c2d1e..6bafdec691eb85c750908125963974bcf9749268 100644 (file)
@@ -5390,7 +5390,7 @@ static struct extent_map *get_extent_skip_holes(struct btrfs_inode *inode,
                        break;
                len = ALIGN(len, sectorsize);
                em = btrfs_get_extent_fiemap(inode, offset, len);
-               if (IS_ERR_OR_NULL(em))
+               if (IS_ERR(em))
                        return em;
 
                /* if this isn't a hole return it */