Skip to content

Commit

Permalink
btrfs: remove zero length check when entering fiemap
Browse files Browse the repository at this point in the history
There's no point to check for a 0 length at extent_fiemap(), as before
calling it, we called fiemap_prep() at btrfs_fiemap(), which already
checks for a zero length and returns the same -EINVAL error. So remove
the pointless check.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Filipe Manana authored and David Sterba committed Sep 26, 2022
1 parent f12eec9 commit 9a42bba
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -5455,9 +5455,6 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo,
u64 em_len = 0;
u64 em_end = 0;

if (len == 0)
return -EINVAL;

path = btrfs_alloc_path();
if (!path)
return -ENOMEM;
Expand Down

0 comments on commit 9a42bba

Please sign in to comment.