From 9a42bbaeff2b101ffdb7fc8c3a326bff08a33917 Mon Sep 17 00:00:00 2001 From: Filipe Manana Date: Thu, 1 Sep 2022 14:18:24 +0100 Subject: 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 --- fs/btrfs/extent_io.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'fs/btrfs/extent_io.c') diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index b5fa92739a5e..8f143c10d81b 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; -- cgit v1.2.3