Skip to contentSkip to conversation

btrfs: Only BUG_ON when the errno is not ENOENT

PATCH New Zhu Yanhai 1 participant 1 message Sep 9, 2010 Btrfs file system

lore
Share & tools
lore

Zhu Yanhai

author
#0 lore raw

PATCH 1/1 btrfs: Only BUG_ON when the errno is not ENOENT

As Andi Kleen's commit 018db35864fd8d307066485a2753866240c3dace makes btrfs_del_dir_entries_in_log() able to return the real errno instead of a zero, we should only BUG_ON it when it's non-zero and not -ENOENT.

---
 fs/btrfs/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/btrfs/inode.c +1 -1
index c038644..4016b1d 100644
@@ -2651,7 +2651,7 @@ int btrfs_unlink_inode(struct btrfs_trans_handle *trans,
 
 	ret = btrfs_del_dir_entries_in_log(trans, root, name, name_len,
 					   dir, index);
-	BUG_ON(ret);
+	BUG_ON(ret != 0 && ret != -ENOENT);
 err:
 	btrfs_free_path(path);
 	if (ret)
Signature · 1 line
1.7.2.2