From: Mark Fasheh <mfasheh@suse.de>
To: linux-btrfs@vger.kernel.org
Cc: chris.mason@oracle.com, Mark Fasheh <mfasheh@suse.com>,
Mark Fasheh <mfasheh@suse.de>
Subject: [PATCH 5/8] btrfs: Don't BUG_ON errors in __finish_chunk_alloc()
Date: Thu, 18 Aug 2011 14:56:58 -0700 [thread overview]
Message-ID: <1313704621-15219-6-git-send-email-mfasheh@suse.de> (raw)
In-Reply-To: <1313704621-15219-1-git-send-email-mfasheh@suse.de>
From: Mark Fasheh <mfasheh@suse.com>
All callers of __finish_chunk_alloc() BUG_ON() return value, so it's trivial
for us to always bubble up any errors caught in __finish_chunk_alloc() to be
caught there.
Signed-off-by: Mark Fasheh <mfasheh@suse.de>
---
fs/btrfs/volumes.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 53875ae..5d166c2 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2600,16 +2600,13 @@ static int __finish_chunk_alloc(struct btrfs_trans_handle *trans,
key.offset = chunk_offset;
ret = btrfs_insert_item(trans, chunk_root, &key, chunk, item_size);
- BUG_ON(ret);
-
- if (map->type & BTRFS_BLOCK_GROUP_SYSTEM) {
+ if (ret == 0 && map->type & BTRFS_BLOCK_GROUP_SYSTEM) {
ret = btrfs_add_system_chunk(trans, chunk_root, &key, chunk,
item_size);
- BUG_ON(ret);
}
kfree(chunk);
- return 0;
+ return ret;
}
/*
--
1.7.6
next prev parent reply other threads:[~2011-08-18 21:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-18 21:56 [PATCH 0/8] btrfs: Error handling fixes Mark Fasheh
2011-08-18 21:56 ` [PATCH 1/8] btrfs: Don't BUG_ON errors from btrfs_create_subvol_root() Mark Fasheh
2011-08-18 21:56 ` [PATCH 2/8] btrfs: Don't BUG_ON() errors in update_ref_for_cow() Mark Fasheh
2011-08-18 21:56 ` [PATCH 3/8] btrfs: Don't BUG_ON kzalloc error in btrfs_lookup_csums_range() Mark Fasheh
2011-08-18 21:56 ` [PATCH 4/8] btrfs: make insert_ptr() void Mark Fasheh
2011-08-18 21:56 ` Mark Fasheh [this message]
2011-08-18 21:56 ` [PATCH 6/8] btrfs: fix error check of btrfs_lookup_dentry() Mark Fasheh
2011-08-18 21:57 ` [PATCH 7/8] btrfs: make fixup_low_keys() void Mark Fasheh
2011-08-18 21:57 ` [PATCH 8/8] btrfs: make del_ptr() and btrfs_del_leaf() void Mark Fasheh
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=1313704621-15219-6-git-send-email-mfasheh@suse.de \
--to=mfasheh@suse.de \
--cc=chris.mason@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=mfasheh@suse.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).