From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp1040.oracle.com ([156.151.31.81]:22924 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751903Ab3GaKCl (ORCPT ); Wed, 31 Jul 2013 06:02:41 -0400 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r6VA2e35027467 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 31 Jul 2013 10:02:41 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6VA2eir001726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 31 Jul 2013 10:02:40 GMT Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6VA2eK3001713 for ; Wed, 31 Jul 2013 10:02:40 GMT Date: Wed, 31 Jul 2013 18:02:34 +0800 From: Liu Bo To: Anand Jain Cc: linux-btrfs Subject: Re: [bug] balance BUG at fs/btrfs/relocation.c:886 Message-ID: <20130731100233.GE5691@localhost.localdomain> Reply-To: bo.li.liu@oracle.com References: <51F8DE99.6060704@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <51F8DE99.6060704@oracle.com> Sender: linux-btrfs-owner@vger.kernel.org List-ID: On Wed, Jul 31, 2013 at 05:53:29PM +0800, Anand Jain wrote: > > 3.11.0-rc3+ > > > ------------------ > [ 225.586356] kernel BUG at fs/btrfs/relocation.c:886! > [ 225.586362] invalid opcode: 0000 [#1] SMP > :: > [ 225.586431] Call Trace: > [ 225.586440] [] ? > btree_read_extent_buffer_pages.clone.4+0xd1/0x120 [btrfs] > [ 225.586447] [] > relocate_tree_blocks+0x363/0x6d0 [btrfs] > [ 225.586454] [] ? tree_insert+0x4c/0x60 [btrfs] > [ 225.586461] [] > relocate_block_group+0x323/0x640 [btrfs] > [ 225.586469] [] > btrfs_relocate_block_group+0x19f/0x2c0 [btrfs] > [ 225.586477] [] btrfs_relocate_chunk+0x88/0x770 [btrfs] > [ 225.586485] [] ? read_extent_buffer+0xb1/0x110 [btrfs] > [ 225.586493] [] ? btrfs_get_token_64+0x5f/0xf0 [btrfs] > [ 225.586500] [] btrfs_balance+0x891/0xe40 [btrfs] > [ 225.586508] [] ? kzalloc+0xf/0x20 [btrfs] > [ 225.586552] [] ? __kmalloc+0xf5/0x170 > [ 225.586560] [] btrfs_ioctl_balance+0x21a/0x330 [btrfs] > [ 225.586568] [] btrfs_ioctl+0x585/0x1660 [btrfs] > [ 225.586575] [] ? handle_mm_fault+0x12b/0x230 > [ 225.586590] [] do_vfs_ioctl+0x84/0x4c0 > [ 225.586616] [] ? inode_has_perm.clone.0+0x2d/0x30 > [ 225.586618] [] ? file_has_perm+0x8a/0xa0 > [ 225.586625] [] ? final_putname+0x21/0x50 > [ 225.586627] [] SyS_ioctl+0x91/0xa0 > [ 225.586670] [] system_call_fastpath+0x16/0x1b > ------------------- > > > if (btrfs_root_level(&root->root_item) == cur->level) { > /* tree root */ > BUG_ON(btrfs_root_bytenr(&root->root_item) != > cur->bytenr); > if (should_ignore_root(root)) > list_add(&cur->list, &useless); > else > cur->root = root; > break; > } > > > > reproducer: > > --------------------- > # mkfs.btrfs /dev/sdb -f > > # btrfsck --init-csum /dev/sdb > Creating a new CRC tree > Checking filesystem on /dev/sdb > UUID: 51576f7d-af1d-458b-b3c5-02eda4b3c39f > checking extents > Reinit crc root > found 0 bytes used err is 0 > total csum bytes: 0 > total tree bytes: 0 > total fs tree bytes: 0 > total extent tree bytes: 0 > btree space waste bytes: 0 > file data blocks allocated: 0 > referenced 0 > Btrfs v0.20-rc1-413-g3f4deb0-dirty > > # mount /dev/sdb /btrfs > > # btrfs fi bal /btrfs > Segmentation fault > # > --------------------- > > Any idea how do we fix this ? > ( other than don't run --init-csum :-) ) Btw, my result of running the reproducer didn't crash but gave [43880.144535] parent transid verify failed on 29360128 wanted 5 found 4 [43880.144854] parent transid verify failed on 29360128 wanted 5 found 4 [43880.152389] btrfs: open_ctree failed (29360128 refers to fs root.) -liubo