From patchwork Wed Jun 1 09:42:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liubo X-Patchwork-Id: 838342 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p519jFYL028267 for ; Wed, 1 Jun 2011 09:45:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757243Ab1FAJpK (ORCPT ); Wed, 1 Jun 2011 05:45:10 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:61764 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1756940Ab1FAJpI (ORCPT ); Wed, 1 Jun 2011 05:45:08 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 4413E170151 for ; Wed, 1 Jun 2011 17:45:06 +0800 (CST) Received: from mailserver.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id p519j5HR009745; Wed, 1 Jun 2011 17:45:06 +0800 Received: from localhost.localdomain ([10.167.225.27]) by mailserver.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.1FP4) with ESMTP id 2011060117450182-453008 ; Wed, 1 Jun 2011 17:45:01 +0800 Message-ID: <4DE60999.4000208@cn.fujitsu.com> Date: Wed, 01 Jun 2011 17:42:49 +0800 From: liubo User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: Tsutomu Itoh CC: Linux Btrfs Subject: Re: [3.0-rc1] kernel BUG at fs/btrfs/relocation.c:4285! References: <4DE43607.2090105@jp.fujitsu.com> <4DE5EDF0.4030601@cn.fujitsu.com> <4DE5F450.9000506@cn.fujitsu.com> In-Reply-To: <4DE5F450.9000506@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2011-06-01 17:45:01, Serialize by Router on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2011-06-01 17:45:02, Serialize complete at 2011-06-01 17:45:02 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 01 Jun 2011 09:45:16 +0000 (UTC) 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 [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 --- 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;