All of lore.kernel.org
 help / color / mirror / Atom feed
From: liubo <liubo2009@cn.fujitsu.com>
To: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Cc: Linux Btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [3.0-rc1] kernel BUG at fs/btrfs/relocation.c:4285!
Date: Wed, 01 Jun 2011 17:42:49 +0800	[thread overview]
Message-ID: <4DE60999.4000208@cn.fujitsu.com> (raw)
In-Reply-To: <4DE5F450.9000506@cn.fujitsu.com>

On 06/01/2011 04:12 PM, liubo wrote:
> On 06/01/2011 03:44 PM, liubo wrote:
>> > On 05/31/2011 08:27 AM, Tsutomu Itoh wrote:
>>>> >> > The panic occurred when 'btrfs fi bal /test5' was executed.
>>>> >> > 
>>>> >> > /test5 is as follows:
>>>> >> > # mount -o space_cache,compress=lzo /dev/sdc3 /test5
>>>> >> > #
>>>> >> > # btrfs fi sh /dev/sdc3
>>>> >> > Label: none  uuid: 38ec48b2-a64b-4225-8cc6-5eb08024dc64
>>>> >> >         Total devices 5 FS bytes used 7.87MB
>>>> >> >         devid    1 size 10.00GB used 2.02GB path /dev/sdc3
>>>> >> >         devid    2 size 15.01GB used 3.00GB path /dev/sdc5
>>>> >> >         devid    3 size 15.01GB used 3.00GB path /dev/sdc6
>>>> >> >         devid    4 size 20.01GB used 2.01GB path /dev/sdc7
>>>> >> >         devid    5 size 10.00GB used 2.01GB path /dev/sdc8
>>>> >> > 
>>>> >> > Btrfs v0.19-50-ge6bd18d
>>>> >> > # btrfs fi df /test5
>>>> >> > Data, RAID0: total=10.00GB, used=3.52MB
>>>> >> > Data: total=8.00MB, used=1.60MB
>>>> >> > System, RAID1: total=8.00MB, used=4.00KB
>>>> >> > System: total=4.00MB, used=0.00
>>>> >> > Metadata, RAID1: total=1.00GB, used=216.00KB
>>>> >> > Metadata: total=8.00MB, used=0.00
>>>> >> > 
>> > 
>> > Hi, Itoh san, 
>> > 
>> > I've come up with a patch aiming to fix this bug.
>> > The problems is that the inode allocator stores one inode cache per root,
>> > which is at least not good for relocation tree, cause we only find
>> > new inode number from fs tree or file tree (subvol/snapshot).
>> > 
>> > I've tested with your run.sh and it works well on my box, so you can try this:
>> > 

I've tested the following patch for about 1.5 hour, and nothing happened.
And would you please test this patch?

thanks,

From: Liu Bo <liubo2009@cn.fujitsu.com>

[PATCH] Btrfs: fix save ino cache bug

We just get new inode number from fs root or subvol/snap root,
so we'd like to save fs/subvol/snap root's inode cache into disk.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
---
 fs/btrfs/inode-map.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/fs/btrfs/inode-map.c b/fs/btrfs/inode-map.c
index 0009705..8c0c25b 100644
--- a/fs/btrfs/inode-map.c
+++ b/fs/btrfs/inode-map.c
@@ -372,6 +372,12 @@ int btrfs_save_ino_cache(struct btrfs_root *root,
 	int prealloc;
 	bool retry = false;
 
+	/* only fs tree and subvol/snap needs ino cache */
+	if (root->root_key.objectid != BTRFS_FS_TREE_OBJECTID &&
+	    (root->root_key.objectid < BTRFS_FIRST_FREE_OBJECTID ||
+	     root->root_key.objectid > BTRFS_LAST_FREE_OBJECTID))
+		return 0;
+
 	path = btrfs_alloc_path();
 	if (!path)
 		return -ENOMEM;
-- 
1.6.5.2


  reply	other threads:[~2011-06-01  9:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-31  0:27 [3.0-rc1] kernel BUG at fs/btrfs/relocation.c:4285! Tsutomu Itoh
2011-05-31  1:13 ` Chris Mason
2011-05-31  4:31   ` Tsutomu Itoh
2011-05-31  6:13     ` liubo
2011-05-31  6:58       ` Tsutomu Itoh
2011-06-01  7:44 ` liubo
2011-06-01  8:12   ` liubo
2011-06-01  9:42     ` liubo [this message]
2011-06-01 10:44       ` Tsutomu Itoh
2011-06-06  1:20         ` Tsutomu Itoh

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=4DE60999.4000208@cn.fujitsu.com \
    --to=liubo2009@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=t-itoh@jp.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.