Skip to content

Commit

Permalink
Btrfs: fixup return code for btrfs_del_orphan_item
Browse files Browse the repository at this point in the history
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: Josef Bacik <josef@redhat.com>
  • Loading branch information
Josef Bacik committed Dec 9, 2010
1 parent b8399de commit 7e1fea7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/btrfs/orphan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 7e1fea7

Please sign in to comment.