Skip to content

Commit 45cc960

Browse files
fdmananakdave
authored andcommitted
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 <[email protected]> Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 01cebce commit 45cc960

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

fs/btrfs/dir-item.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,7 @@ int btrfs_check_dir_item_collision(struct btrfs_root *root, u64 dir_ino,
253253
/* Nothing found, we're safe */
254254
if (ret == -ENOENT)
255255
return 0;
256-
257-
if (ret < 0)
258-
return ret;
256+
return ret;
259257
}
260258

261259
/* we found an item, look for our name in the item */

0 commit comments

Comments
 (0)