summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2026-02-25 19:22:41 +0000
committerDavid Sterba <dsterba@suse.com>2026-04-07 18:56:00 +0200
commit45cc960ff777ac9f4e57c896f1d01adc99fd696e (patch)
tree1470231d509b78106e04d7e19be7d4dc047fe7e0
parent01cebce71f2f90abe6a98d3066c085a34b95d96e (diff)
btrfs: remove pointless error check in btrfs_check_dir_item_collision()
We're under the IS_ERR() branch so we know that 'ret', which got assigned the value of PTR_ERR(di) is always negative, so there's no point in checking if it's negative. Reviewed-by: Boris Burkov <boris@bur.io> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/dir-item.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c
index 085a83ae9e62..84f1c64423d3 100644
--- a/fs/btrfs/dir-item.c
+++ b/fs/btrfs/dir-item.c
@@ -253,9 +253,7 @@ int btrfs_check_dir_item_collision(struct btrfs_root *root, u64 dir_ino,
/* Nothing found, we're safe */
if (ret == -ENOENT)
return 0;
-
- if (ret < 0)
- return ret;
+ return ret;
}
/* we found an item, look for our name in the item */