linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhu Yanhai <zhu.yanhai@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: vivian.zhang@intel.com, Zhu Yanhai <zhu.yanhai@gmail.com>
Subject: [PATCH] btrfs: Only BUG_ON when the errno is not ENOENT
Date: Thu,  9 Sep 2010 23:26:17 +0800	[thread overview]
Message-ID: <1284045977-3704-1-git-send-email-zhu.yanhai@gmail.com> (raw)

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.

Signed-off-by: Zhu Yanhai <zhu.yanhai@gmail.com>
---
 fs/btrfs/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index c038644..4016b1d 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -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)
-- 
1.7.2.2


                 reply	other threads:[~2010-09-09 15:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1284045977-3704-1-git-send-email-zhu.yanhai@gmail.com \
    --to=zhu.yanhai@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=vivian.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).