From patchwork Mon Jul 2 04:20:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liubo X-Patchwork-Id: 1145431 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 88A57DFFD2 for ; Mon, 2 Jul 2012 04:40:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751794Ab2GBEkP (ORCPT ); Mon, 2 Jul 2012 00:40:15 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:59019 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751247Ab2GBEkN (ORCPT ); Mon, 2 Jul 2012 00:40:13 -0400 X-IronPort-AV: E=Sophos;i="4.77,508,1336320000"; d="scan'208";a="5302777" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 02 Jul 2012 12:39:22 +0800 Received: from fnstmail02.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 q624Ak2T026409; Mon, 2 Jul 2012 12:10:52 +0800 Received: from localhost.localdomain ([10.167.225.27]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2012070212105305-463918 ; Mon, 2 Jul 2012 12:10:53 +0800 Message-ID: <4FF12190.9090005@cn.fujitsu.com> Date: Mon, 02 Jul 2012 12:20:32 +0800 From: Liu Bo 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: Daniel J Blueman CC: Chris Mason , Linux BTRFS Subject: Re: Please hammer my for-linus branch References: In-Reply-To: X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/07/02 12:10:53, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/07/02 12:11:12, Serialize complete at 2012/07/02 12:11:12 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On 07/02/2012 11:35 AM, Daniel J Blueman wrote: >> Hi everyone, >> >> I've got a nice set of fixes from Josef, Jan, Ilya and others in my >> for-linus branch: >> >> git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git for-linus >> >> Some of the changes are fixes for the tree logging code, so I ran some >> extra crash runs against them Friday night. >> >> I ended up with a new crash in the tree log directory deletion replay >> code, so I didn't send out the pull request to Linus. >> >> It isn't clear yet if the new crash is because I was testing differently >> or if it is a regression. I'm nailing it down this weekend, but please >> give my for-linus a shot. > > With this branch (3.4.0), my test has consistently been hitting the > BUG_ON(owner < BTRFS_FIRST_FREE_OBJECTID) in > insert_inline_extent_backref [1]. This is followed by a string of > other issues [2] and a hard lockup, so I used netconsole to collect > this. > > I'm preparing my btrfs test for xfstests integration, but can slip you > it if interested. It hits this case in ~30s. > IMO the BUG_ON is meant to avoid to mix 'log tree' in, it should be: BUG_ON(owner < BTRFS_FIRST_FREE_OBJECTID && root_objectid == BTRFS_TREE_LOG_OBJECTID); This should help you, can you give it a try? thanks, liubo > Thanks, > Daniel > > --- [1] > > kernel BUG at fs/btrfs/extent-tree.c:1769! > invalid opcode: 0000 [#1] SMP > CPU 0 > Modules linked in: brd netconsole dm_crypt dm_mod kvm_intel kvm > coretemp microcode uvcvideo videobuf2_core iwlwifi videodev > videobuf2_vmalloc videobuf2_memops btrfs i915 cfbcopyarea video > cfbimgblt cfbfillrect > > Pid: 3219, comm: btrfs Not tainted 3.4.0-debug+ #1 Dell Inc. Latitude > E5420/0H5TG2 > RIP: 0010:[] [] > insert_inline_extent_backref+0xe7/0xf0 [btrfs] > RSP: 0018:ffff8801924df8c8 EFLAGS: 00010293 > RAX: 0000000000000000 RBX: ffff8801ea7ae3f0 RCX: ffff8801924df910 > RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000 > RBP: ffff8801924df948 R08: 0000000000000f4c R09: 0000000000000001 > R10: 0000000000000000 R11: 0000000000000000 R12: ffff8801101e0000 > R13: ffff8801e6ed30f0 R14: 0000000000000000 R15: 0000000000000000 > FS: 00007f1b3bf80740(0000) GS:ffff88022ec00000(0000) knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b > CR2: 000000000042c430 CR3: 0000000195a05000 CR4: 00000000000407f0 > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 > Process btrfs (pid: 3219, threadinfo ffff8801924de000, task ffff880223e23dc0) > Stack: > 0000000000000000 0000000000000005 0000000000000000 0000000000000000 > ffff880200000001 0000000000000005 ffff8801924df938 ffffffff81110457 > ffff8801101e1800 0000000000000f43 ffff8801101e1800 ffff8801ea7ae3f0 > Call Trace: > [] ? kmem_cache_alloc+0xe7/0x180 > [] __btrfs_inc_extent_ref+0x9a/0x1f0 [btrfs] > [] run_delayed_tree_ref+0x167/0x190 [btrfs] > [] run_one_delayed_ref+0xde/0xf0 [btrfs] > [] run_clustered_refs+0xdd/0x370 [btrfs] > [] btrfs_run_delayed_refs+0x149/0x340 [btrfs] > [] __btrfs_end_transaction+0xa7/0x360 [btrfs] > [] btrfs_end_transaction_throttle+0x13/0x20 [btrfs] > [] relocate_block_group+0x439/0x560 [btrfs] > [] btrfs_relocate_block_group+0x1c4/0x300 [btrfs] > [] btrfs_relocate_chunk.isra.52+0x4a/0x240 [btrfs] > [] ? free_extent_buffer+0x32/0x90 [btrfs] > [] __btrfs_balance+0x2f4/0x3f0 [btrfs] > [] btrfs_balance+0x2f3/0x4d0 [btrfs] > [] btrfs_ioctl_balance+0x140/0x290 [btrfs] > [] btrfs_ioctl+0x5c7/0x7f0 [btrfs] > [] ? do_brk+0x246/0x360 > [] do_vfs_ioctl+0x87/0x340 > [] ? lockdep_sys_exit_thunk+0x35/0x67 > [] sys_ioctl+0x4a/0x80 > [] system_call_fastpath+0x16/0x1b > Code: 89 e6 4c 89 ef 48 8b 4d c8 4c 89 3c 24 48 89 44 24 18 8b 45 28 > 89 44 24 10 48 8b 45 20 48 89 44 24 08 e8 1d fa ff ff 31 c0 eb a4 <0f> > 0b 0f 1f 80 00 00 00 00 55 48 89 e5 48 83 c4 80 48 89 5d d8 > RIP [] insert_inline_extent_backref+0xe7/0xf0 [btrfs] > RSP > > --- [2] > > BUG: sleeping function called from invalid context at kernel/rwsem.c:20 > in_atomic(): 1, irqs_disabled(): 0, pid: 3219, name: btrfs > INFO: lockdep is turned off. > Pid: 3219, comm: btrfs Tainted: G D 3.4.0-debug+ #1 > Call Trace: > [] __might_sleep+0x142/0x240 > [] down_read+0x1f/0x5c > [] exit_signals+0x1f/0x130 > [] do_exit+0xb6/0x480 > [] oops_end+0x77/0xb0 > [] die+0x53/0x80 > [] do_trap+0xc4/0x170 > [] do_invalid_op+0x90/0xb0 > [] ? insert_inline_extent_backref+0xe7/0xf0 [btrfs] > [] ? btrfs_search_slot+0x67b/0x760 [btrfs] > [] ? btrfs_leaf_free_space+0x5f/0xb0 [btrfs] > [] ? trace_hardirqs_off_thunk+0x3a/0x3c > [] ? restore_args+0x30/0x30 > [] invalid_op+0x15/0x20 > [] ? insert_inline_extent_backref+0xe7/0xf0 [btrfs] > [] ? insert_inline_extent_backref+0x5e/0xf0 [btrfs] > [] ? kmem_cache_alloc+0xe7/0x180 > [] __btrfs_inc_extent_ref+0x9a/0x1f0 [btrfs] > [] run_delayed_tree_ref+0x167/0x190 [btrfs] > [] run_one_delayed_ref+0xde/0xf0 [btrfs] > [] run_clustered_refs+0xdd/0x370 [btrfs] > [] btrfs_run_delayed_refs+0x149/0x340 [btrfs] > [] __btrfs_end_transaction+0xa7/0x360 [btrfs] > [] btrfs_end_transaction_throttle+0x13/0x20 [btrfs] > [] relocate_block_group+0x439/0x560 [btrfs] > [] btrfs_relocate_block_group+0x1c4/0x300 [btrfs] > [] btrfs_relocate_chunk.isra.52+0x4a/0x240 [btrfs] > [] ? free_extent_buffer+0x32/0x90 [btrfs] > [] __btrfs_balance+0x2f4/0x3f0 [btrfs] > [] btrfs_balance+0x2f3/0x4d0 [btrfs] > [] btrfs_ioctl_balance+0x140/0x290 [btrfs] > [] btrfs_ioctl+0x5c7/0x7f0 [btrfs] > [] ? do_brk+0x246/0x360 > [] do_vfs_ioctl+0x87/0x340 > [] ? lockdep_sys_exit_thunk+0x35/0x67 > [] sys_ioctl+0x4a/0x80 > [] system_call_fastpath+0x16/0x1b > > BUG: scheduling while atomic: btrfs/3219/0x10000002 > INFO: lockdep is turned off. > Modules linked in: brd netconsole dm_crypt dm_mod kvm_intel kvm > coretemp microcode uvcvideo videobuf2_core iwlwifi videodev > videobuf2_vmalloc videobuf2_memops btrfs i915 cfbcopyarea video > cfbimgblt cfbfillrect > Pid: 3219, comm: btrfs Tainted: G D 3.4.0-debug+ #1 > Call Trace: > [] __schedule_bug+0x5d/0x61 > [] __schedule+0x8fb/0x9a0 > [] ? show_trace_log_lvl+0x57/0x70 > [] ? show_trace+0x10/0x20 > [] ? dump_stack+0x72/0x7b > [] __cond_resched+0x25/0x40 > [] _cond_resched+0x2d/0x40 > [] down_read+0x24/0x5c > [] exit_signals+0x1f/0x130 > [] do_exit+0xb6/0x480 > [] oops_end+0x77/0xb0 > [] die+0x53/0x80 > [] do_trap+0xc4/0x170 > [] do_invalid_op+0x90/0xb0 > [] ? insert_inline_extent_backref+0xe7/0xf0 [btrfs] > [] ? btrfs_search_slot+0x67b/0x760 [btrfs] > [] ? btrfs_leaf_free_space+0x5f/0xb0 [btrfs] > [] ? trace_hardirqs_off_thunk+0x3a/0x3c > [] ? restore_args+0x30/0x30 > [] invalid_op+0x15/0x20 > [] ? insert_inline_extent_backref+0xe7/0xf0 [btrfs] > [] ? insert_inline_extent_backref+0x5e/0xf0 [btrfs] > [] ? kmem_cache_alloc+0xe7/0x180 > [] __btrfs_inc_extent_ref+0x9a/0x1f0 [btrfs] > [] run_delayed_tree_ref+0x167/0x190 [btrfs] > [] run_one_delayed_ref+0xde/0xf0 [btrfs] > [] run_clustered_refs+0xdd/0x370 [btrfs] > [] btrfs_run_delayed_refs+0x149/0x340 [btrfs] > [] __btrfs_end_transaction+0xa7/0x360 [btrfs] > [] btrfs_end_transaction_throttle+0x13/0x20 [btrfs] > [] relocate_block_group+0x439/0x560 [btrfs] > [] btrfs_relocate_block_group+0x1c4/0x300 [btrfs] > [] btrfs_relocate_chunk.isra.52+0x4a/0x240 [btrfs] > [] ? free_extent_buffer+0x32/0x90 [btrfs] > [] __btrfs_balance+0x2f4/0x3f0 [btrfs] > [] btrfs_balance+0x2f3/0x4d0 [btrfs] > [] btrfs_ioctl_balance+0x140/0x290 [btrfs] > [] btrfs_ioctl+0x5c7/0x7f0 [btrfs] > [] ? do_brk+0x246/0x360 > [] do_vfs_ioctl+0x87/0x340 > [] ? lockdep_sys_exit_thunk+0x35/0x67 > [] sys_ioctl+0x4a/0x80 > [] system_call_fastpath+0x16/0x1b > note: btrfs[3219] exited with preempt_count 1 --- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 4b5a1e1..a006017 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -1766,7 +1766,8 @@ int insert_inline_extent_backref(struct btrfs_trans_handle *trans, bytenr, num_bytes, parent, root_objectid, owner, offset, 1); if (ret == 0) { - BUG_ON(owner < BTRFS_FIRST_FREE_OBJECTID); + BUG_ON(owner < BTRFS_FIRST_FREE_OBJECTID && + root_objectid == BTRFS_TREE_LOG_OBJECTID); update_inline_extent_backref(trans, root, path, iref, refs_to_add, extent_op); } else if (ret == -ENOENT) {