From: Ilya Dryomov <idryomov@gmail.com>
To: Leho Kraav <leho@kraav.com>, Daniel J Blueman <daniel@quora.org>,
Linux BTRFS <linux-btrfs@vger.kernel.org>,
Liu Bo <liubo2009@cn.fujitsu.com>
Subject: Re: btrfs 3.2.2 -> 3.3.1 upgrade finally ate babies, some advice?
Date: Tue, 10 Apr 2012 12:07:18 +0300 [thread overview]
Message-ID: <20120410090718.GA2345@zambezi.lan> (raw)
In-Reply-To: <20120409231954.GC11041@twin.jikos.cz>
On Tue, Apr 10, 2012 at 01:19:54AM +0200, David Sterba wrote:
> On Tue, Apr 10, 2012 at 12:32:00AM +0300, Leho Kraav wrote:
> > It is also BUG time WITH the patch. Mount succeeds, but "btrfs fi balance
> > HOME" gives us:
> >
> > Apr 10 00:24:18 server sudo: pam_unix(sudo:session): session opened for user > root by (uid=1000)
> > Apr 10 00:24:18 server kernel: [ 363.839105] ------------[ cut here > ]------------
> > Apr 10 00:24:18 server kernel: [ 363.839163] kernel BUG at > fs/btrfs/volumes.c:2733!
>
> that's
>
> 2732 if (!(bctl->flags & BTRFS_BALANCE_RESUME)) {
> 2733 BUG_ON(ret == -EEXIST);
> ^^^^
> 2734 set_balance_control(bctl);
> 2735 } else {
> 2736 BUG_ON(ret != -EEXIST);
> 2737 spin_lock(&fs_info->balance_lock);
> 2738 update_balance_args(bctl);
> 2739 spin_unlock(&fs_info->balance_lock);
> 2740 }
>
> IIRC somebody reported similar problem recently. It basically means
> there's an inconsistent balance state. Adding Ilya to CC.
Leho, so you just mount with discard patch and run 'btrfs fi balance
<mnt>', correct ?
The problem is that you have balance state on disk (from trying to run
balance earlier w/o discard patch) but we are failing to pick it up on
mount.
Could you please post the entire dmesg and the output of
'btrfs-debug-tree -d <dev>' somewhere ?
Could you also apply the debug patch below, mount your fs and send me
dmesg output (no need to run balance, just mount) ?
Thanks,
Ilya
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 20196f4..86fa082 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1867,6 +1867,7 @@ int open_ctree(struct super_block *sb,
csum_root = fs_info->csum_root = btrfs_alloc_root(fs_info);
chunk_root = fs_info->chunk_root = btrfs_alloc_root(fs_info);
dev_root = fs_info->dev_root = btrfs_alloc_root(fs_info);
+printk("open_ctree\n");
if (!tree_root || !extent_root || !csum_root ||
!chunk_root || !dev_root) {
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index a872b48..2e39348 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2834,6 +2834,7 @@ static int balance_kthread(void *data)
mutex_lock(&fs_info->balance_mutex);
set_balance_control(bctl);
+printk("balance_kthread: flags %llu\n", (unsigned long long)bctl->flags);
if (btrfs_test_opt(fs_info->tree_root, SKIP_BALANCE)) {
printk(KERN_INFO "btrfs: force skipping balance\n");
@@ -2858,6 +2859,7 @@ int btrfs_recover_balance(struct btrfs_root *tree_root)
struct btrfs_key key;
int ret;
+printk("recover_balance\n");
path = btrfs_alloc_path();
if (!path)
return -ENOMEM;
@@ -2872,7 +2874,11 @@ int btrfs_recover_balance(struct btrfs_root *tree_root)
key.type = BTRFS_BALANCE_ITEM_KEY;
key.offset = 0;
+printk("key.obj %llu\n", (unsigned long long)key.objectid);
+printk("key.type %d\n", key.type);
+printk("key.off %llu\n", (unsigned long long)key.offset);
ret = btrfs_search_slot(NULL, tree_root, &key, path, 0, 0);
+printk("search ret %d\n", ret);
if (ret < 0)
goto out_bctl;
if (ret > 0) { /* ret = -ENOENT; */
next prev parent reply other threads:[~2012-04-10 9:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-09 14:35 btrfs 3.2.2 -> 3.3.1 upgrade finally ate babies, some advice? Daniel J Blueman
2012-04-09 14:44 ` Leho Kraav
2012-04-09 14:54 ` Daniel J Blueman
2012-04-09 19:07 ` Martin Steigerwald
2012-04-09 20:58 ` Leho Kraav
2012-04-09 21:32 ` Leho Kraav
2012-04-09 23:19 ` David Sterba
2012-04-10 9:07 ` Ilya Dryomov [this message]
2012-04-10 15:31 ` Leho Kraav
-- strict thread matches above, loose matches on Subject: below --
2012-04-09 13:24 Leho Kraav
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=20120410090718.GA2345@zambezi.lan \
--to=idryomov@gmail.com \
--cc=daniel@quora.org \
--cc=leho@kraav.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=liubo2009@cn.fujitsu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.