Message ID | 53A30BDD.6080309@fb.com (mailing list archive) |
---|---|
State | Under Review |
Headers | show |
On Thu, Jun 19, 2014 at 09:12:13AM -0700, Josef Bacik wrote: > Ok undo what you did and apply this and re-run. It is going spit out a > metric > shittone of data, but all I want is the last chunk of stuff between > > running build_backref_tree > <some shit> > block <some more shit> wasn't checked > done building backref tree > > I changed it to return an error instead of bugging, so if it still bugs > attach > that as well so I can figure out where down the stack we need to fix. > Thanks, Patch applied, here is the new crash. The output is short, so here is all of it: BTRFS info (device sdb1): disk space caching is enabled BTRFS: detected SSD devices, enabling SSD mode BTRFS info (device sdb1): continuing balance BTRFS info (device sdb1): relocating block group 82699091968 flags 1 BTRFS info (device sdb1): found 3719 extents running build_backref_tree building backref for bytenr 73005293568 adding block in path 173444124672, level 1, cur level 0, need_check 1 adding block in path 2176913408, level 3, cur level 0, need_check 0 doing the checking for block 173444124672 building backref for bytenr 173444124672 exist is 67327229952, checked 1 found shared ref 173244198912, needs checking doing the checking for block 173244198912 building backref for bytenr 173244198912 found shared ref 2177122304, needs checking found shared ref 2177081344, needs checking found shared ref 2176827392, needs checking doing the checking for block 2177122304 building backref for bytenr 2177122304 doing the checking for block 2177081344 building backref for bytenr 2177081344 doing the checking for block 2176827392 building backref for bytenr 2176827392 block 2176913408 wasn't checked done building backref tree ------------[ cut here ]------------ kernel BUG at fs/btrfs/relocation.c:443! invalid opcode: 0000 [#1] PREEMPT SMP Modules linked in: des_generic nfsv3 nfsv4 xt_NFLOG nfnetlink_log nfnetlink xt_tcpudp xt_comment xt_multiport ip6table_filter ip6_tables iptable_filter ip_tables x_tables fuse autofs4 bnep rfcomm parport_pc ppdev binfmt_misc ecb intel_rapl rpcsec_gss_krb5 btusb bluetooth 6lowpan_iphc nfsd nfs_acl auth_rpcgss x86_pkg_temp_thermal intel_powerclamp coretemp nfs fscache lockd sunrpc kvm crct10dif_pclmul crc32_pclmul snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic crc32c_intel snd_usb_audio snd_hda_intel ghash_clmulni_intel snd_hda_controller snd_hda_codec snd_hwdep snd_usbmidi_lib snd_pcm_oss snd_mixer_oss snd_pcm uvcvideo videobuf2_core videodev snd_seq_midi snd_seq_midi_event aesni_intel snd_seq snd_rawmidi media videobuf2_vmalloc videobuf2_memops snd_timer snd_seq_device ablk_helper psmouse serio_raw hp_wmi sparse_keymap tpm_infineon cryptd lrw gf128mul glue_helper snd soundcore rfkill sb_edac aes_x86_64 edac_core ehci_pci lpc_ich microcode ehci_hcd tpm_tis evde v wmi tpm processor lp parport loop hid_generic usbhid hid uas usb_storage dm_mod firewire_ohci firewire_core xhci_hcd crc_itu_t usbcore isci usb_common e1000e libsas ptp pps_core scsi_transport_sas CPU: 4 PID: 14292 Comm: btrfs-balance Not tainted 3.15.1-amd64-i915-preempt-20140216jbp2 #2 Hardware name: Hewlett-Packard HP Z620 Workstation/158A, BIOS J61 v01.17 11/05/2012 task: ffff880fae66e6d0 ti: ffff880fae37c000 task.ti: ffff880fae37c000 RIP: 0010:[<ffffffff81268d33>] [<ffffffff81268d33>] remove_backref_node+0x64/0xd5 RSP: 0018:ffff880fae37fc10 EFLAGS: 00010283 RAX: 0000000000000047 RBX: ffff8808065863c0 RCX: ffff880803c350e8 RDX: 0000000000000048 RSI: ffff8807e67cc280 RDI: 0000000000000282 RBP: ffff880fae37fc40 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 00000000ffe8f802 R12: ffff8808065865c0 R13: ffff880803c35020 R14: ffff8807e67cc280 R15: ffff880806586600 FS: 0000000000000000(0000) GS:ffff88082fc80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fff53d50020 CR3: 0000000001c13000 CR4: 00000000000407e0 Stack: ffff880803c35124 ffff8807cbe1fd10 ffff880803c35108 ffff880803c350e8 00000000ffffffea ffff880803c35000 ffff880fae37fcb8 ffffffff8126afa6 ffff880803c35020 000000011af11358 ffffea001af11390 0000000000000000 Call Trace: [<ffffffff8126afa6>] relocate_block_group+0x390/0x49a [<ffffffff8126b20b>] btrfs_relocate_block_group+0x15b/0x26d [<ffffffff81249b80>] btrfs_relocate_chunk.isra.23+0x5c/0x5e8 [<ffffffff8161fb8b>] ? _raw_spin_unlock+0x17/0x2a [<ffffffff812458cc>] ? free_extent_buffer+0x8a/0x8d [<ffffffff8124c406>] btrfs_balance+0x9b6/0xb74 [<ffffffff8161684d>] ? printk+0x54/0x56 [<ffffffff8124c5c4>] ? btrfs_balance+0xb74/0xb74 [<ffffffff8124c61d>] balance_kthread+0x59/0x7b [<ffffffff8106b4b4>] kthread+0xae/0xb6 [<ffffffff8106b406>] ? __kthread_parkme+0x61/0x61 [<ffffffff816266fc>] ret_from_fork+0x7c/0xb0 [<ffffffff8106b406>] ? __kthread_parkme+0x61/0x61 Code: f7 49 8b 5e 28 e8 3a c9 ff ff 49 8d 7e 10 e8 31 c9 ff ff 48 8b 7d d0 4c 89 f6 e8 89 d8 ff ff 48 3b 1b 75 1d 4d 39 7c 24 40 74 02 <0f> 0b 4c 89 e6 4c 89 ef 49 89 dc e8 2f ff ff ff 80 4b 71 02 eb RIP [<ffffffff81268d33>] remove_backref_node+0x64/0xd5 RSP <ffff880fae37fc10> ---[ end trace 3611f7c2174a33f9 ]--- Kernel panic - not syncing: Fatal exception Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffff9fffffff) ---[ end Kernel panic - not syncing: Fatal exception
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 65245a0..915aab4 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -702,6 +702,7 @@ struct backref_node *build_backref_tree(struct reloc_control *rc, int err = 0; bool need_check = true; + printk(KERN_ERR "running build_backref_tree\n"); path1 = btrfs_alloc_path(); path2 = btrfs_alloc_path(); if (!path1 || !path2) { @@ -722,6 +723,7 @@ struct backref_node *build_backref_tree(struct reloc_control *rc, node->lowest = 1; cur = node; again: + printk(KERN_ERR "building backref for bytenr %llu\n", cur->bytenr); end = 0; ptr = 0; key.objectid = cur->bytenr; @@ -757,6 +759,7 @@ again: */ if (!exist->checked) list_add_tail(&edge->list[UPPER], &list); + printk(KERN_ERR "exist is %llu, checked %d\n", exist->bytenr, exist->checked); } else { exist = NULL; } @@ -865,6 +868,7 @@ again: * cached, add the block to pending list */ list_add_tail(&edge->list[UPPER], &list); + printk(KERN_ERR "found shared ref %llu, needs checking\n", upper->bytenr); } else { upper = rb_entry(rb_node, struct backref_node, rb_node); @@ -962,9 +966,10 @@ again: * if we know the block isn't shared * we can void checking its backrefs. */ - if (btrfs_block_can_be_shared(root, eb)) + if (btrfs_block_can_be_shared(root, eb)) { + printk(KERN_ERR "adding block in path %llu, level %d, cur level %d, need_check %d\n", upper->bytenr, upper->level, cur->level, need_check); upper->checked = 0; - else + } else upper->checked = 1; /* @@ -1019,6 +1024,7 @@ next: edge = list_entry(list.next, struct backref_edge, list[UPPER]); list_del_init(&edge->list[UPPER]); cur = edge->node[UPPER]; + printk(KERN_ERR "doing the checking for block %llu\n", cur->bytenr); goto again; } @@ -1062,7 +1068,12 @@ next: continue; } - BUG_ON(!upper->checked); + if (!upper->checked) { + printk(KERN_ERR "block %llu wasn't checked\n", + upper->bytenr); + err = -EINVAL; + goto out; + } BUG_ON(cowonly != upper->cowonly); if (!cowonly) { rb_node = tree_insert(&cache->rb_root, upper->bytenr, @@ -1114,6 +1125,7 @@ next: } } out: + printk(KERN_ERR "done building backref tree\n"); btrfs_free_path(path1); btrfs_free_path(path2); if (err) {