summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/uuid-tree.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2024-01-24 15:59:36 +0100
committerDavid Sterba <dsterba@suse.com>2024-03-04 16:24:48 +0100
commit5378ea6ea095e25bb32fa1a76e29c8aa4a3ff6c5 (patch)
tree8fd021bc34e4367f5a5ff1d7249b7c20cc1498d6 /fs/btrfs/uuid-tree.c
parent53e4d8c29095f169be2b1593bff8e4feb44ce94e (diff)
downloadlinux-5378ea6ea095e25bb32fa1a76e29c8aa4a3ff6c5.tar.gz
linux-5378ea6ea095e25bb32fa1a76e29c8aa4a3ff6c5.tar.bz2
linux-5378ea6ea095e25bb32fa1a76e29c8aa4a3ff6c5.zip
btrfs: unify handling of return values of btrfs_insert_empty_items()
The error values returned by btrfs_insert_empty_items() are following the common patter of 0/-errno, but some callers check for a value > 0, which can't happen. Document that and update calls to not expect positive values. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/uuid-tree.c')
-rw-r--r--fs/btrfs/uuid-tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/uuid-tree.c b/fs/btrfs/uuid-tree.c
index b8c6e46dd499..b0aff297d67d 100644
--- a/fs/btrfs/uuid-tree.c
+++ b/fs/btrfs/uuid-tree.c
@@ -113,7 +113,7 @@ int btrfs_uuid_tree_add(struct btrfs_trans_handle *trans, u8 *uuid, u8 type,
ret = btrfs_insert_empty_item(trans, uuid_root, path, &key,
sizeof(subid_le));
- if (ret >= 0) {
+ if (ret == 0) {
/* Add an item for the type for the first time */
eb = path->nodes[0];
slot = path->slots[0];