Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e1fea73 authored by Josef Bacik's avatar Josef Bacik
Browse files

Btrfs: fixup return code for btrfs_del_orphan_item



If the orphan item doesn't exist, we return 1, which doesn't make any sense to
the callers.  Instead return -ENOENT if we didn't find the item.  Thanks,

Signed-off-by: default avatarJosef Bacik <josef@redhat.com>
parent b8399dee
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -56,8 +56,12 @@ int btrfs_del_orphan_item(struct btrfs_trans_handle *trans,
		return -ENOMEM;

	ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
	if (ret)
	if (ret < 0)
		goto out;
	if (ret) {
		ret = -ENOENT;
		goto out;
	}

	ret = btrfs_del_item(trans, root, path);