diff options
author | Josef Bacik <josef@redhat.com> | 2010-12-08 20:22:34 +0300 |
---|---|---|
committer | Josef Bacik <josef@redhat.com> | 2010-12-09 21:57:15 +0300 |
commit | 7e1fea731da8c1b5fcf5d8e157befd389b030760 (patch) | |
tree | 85800034e3b0f8262dd51e128264bec5ce30aed2 /fs/btrfs | |
parent | b8399dee478db7939cd0d6fda8ecacddf2facd03 (diff) | |
download | linux-7e1fea731da8c1b5fcf5d8e157befd389b030760.tar.xz |
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: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/orphan.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/orphan.c b/fs/btrfs/orphan.c index 79cba5fbc28e..f8be250963a0 100644 --- a/fs/btrfs/orphan.c +++ b/fs/btrfs/orphan.c @@ -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); |