From: Filipe Manana Date: Thu, 1 Sep 2022 13:18:24 +0000 (+0100) Subject: btrfs: remove zero length check when entering fiemap X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9a42bbaeff2b101ffdb7fc8c3a326bff08a33917;p=linux.git btrfs: remove zero length check when entering fiemap 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 Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index b5fa92739a5e2..8f143c10d81b7 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -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;