Skip to contentSkip to conversation

Btrfs: fixup return code for btrfs_del_orphan_item

PATCH New Josef Bacik 1 participant 1 message Dec 8, 2010 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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,

---
 fs/btrfs/orphan.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
fs/btrfs/orphan.c +5 -1
index 79cba5f..f8be250 100644
@@ -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);
 
Signature · 1 line
1.6.6.1