btrfs balance crash BUG ON fs/btrfs/relocation.c:1062 or RIP build_backref_tree+0x9fc/0xcc4
I did a balance on a system that had 3.11 (yes, I know, it's old). It hung. So, I rebooted with 3.13, and it failed in fs/btrfs/relocation
Problem #1: I cannot stop the relocation. It starts on its own as soon as I mount the FS, and I can't stop it.
Is there a bug to fix that?
Problem #2: I rebooted with 3.15rc5, and now it's worse.
[ 1569.598026] kernel BUG at fs/btrfs/relocation.c:1064! then leads to [ 1569.613240] RIP [<ffffffff81267ef0>] build_backref_tree+0x9fc/0xcc4 [ 1569.613491] RSP <ffff880fde599ad8> [ 1569.614119] ---[ end trace da0f24875bbde960 ]--- [ 1569.614398] Kernel panic - not syncing: Fatal exception
(full trace below)
I'm sure that filesystem is damaged in some way, but the kernel of course should not crash.
3.15 dies here:
struct backref_node *build_backref_tree(struct reloc_control *rc, (...)
if (!RB_EMPTY_NODE(&upper->rb_node)) {
if (upper->lowest) {
list_del_init(&upper->lower);
upper->lowest = 0;
}
list_add_tail(&edge->list[UPPER], &upper->lower);
continue;
}
BUG_ON(!upper->checked); <<<< hereSo I'm sure I hit a bug and my FS has issues, but can't the kernel do something better like abort the rebalance instead of crashing?
In the meantime, does anyone want anything off that filesystem before I wipe it?
=> Crash on 3.13:
btrfs: found 4930 extents
btrfs: relocating block group 82699091968 flags 1
btrfs: found 3719 extents
------------[ cut here ]------------ kernel BUG at /build/buildd/linux-lts-trusty-3.13.0/fs/btrfs/relocation.c:1062! invalid opcode: 0000 [#1] SMP Modules linked in: rfcomm parport_pc ppdev bnep binfmt_misc rpcsec_gss_krb5 nfsd nfs_acl auth_rpcgss nfs fscache lockd sunrpc snd_hda_codec_hdmi nvidia(POF) snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_usb_audio snd_pcm snd_hwdep snd_usbmidi_lib snd_seq_midi snd_seq_midi_event snd_seq btusb bluetooth uvcvideo videobuf2_core videodev videobuf2_vmalloc videobuf2_memops snd_rawmidi snd_timer snd_seq_device drm snd psmouse gpio_ich sb_edac hp_wmi serio_raw edac_core mei_me mei mac_hid soundcore sparse_keymap snd_page_alloc lpc_ich wmi tpm_infineon lp parport btrfs raid6_pq xor libcrc32c hid_generic usbhid hid usb_storage firewire_ohci isci e1000e firewire_core libsas crc_itu_t ptp ahci libahci pps_core scsi_transport_sas CPU: 4 PID: 1710 Comm: btrfs-balance Tainted: PF O 3.13.0-29-generic #53~precise1-Ubuntu Hardware name: Hewlett-Packard HP Z620 Workstation/158A, BIOS J61 v01.17 11/05/2012 task: ffff881000bec7d0 ti: ffff8810018a2000 task.ti: ffff8810018a2000 RIP: 0010:[<ffffffffa01c04a8>] [<ffffffffa01c04a8>] build_backref_tree+0x1228/0x1290 [btrfs] RSP: 0018:ffff8810018a3ab8 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff880801a8fa20 RCX: ffff880801d2cf50 RDX: ffff880801d2c390 RSI: ffff880801d2c640 RDI: ffff8807ecad9c80 RBP: ffff8810018a3bb8 R08: ffff8807ecad9c80 R09: 0000000000000001 R10: 0000000000000001 R11: 0000000000000000 R12: ffff880801d2c650 R13: ffff8807ecad9900 R14: 0000000000000000 R15: ffff88003582a800 FS: 0000000000000000(0000) GS:ffff88080fc80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f10ee50a370 CR3: 0000000001c0d000 CR4: 00000000000407e0 Stack: ffff8807ecad9780 01ffffffa01bded0 ffff880801d2c620 ffff88003582a920 ffff8807ecad9c80 ffff8807ff72e800 ffff8807ecad9240 ffff8807ecad9200 ffff880801a8fa20 ffff880801a8fab0 ffff88003582a924 ffff88003582a820 Call Trace: [<ffffffffa01c064b>] relocate_tree_blocks+0x13b/0x1e0 [btrfs] [<ffffffffa01c12b9>] relocate_block_group+0x199/0x550 [btrfs] [<ffffffffa01c182a>] btrfs_relocate_block_group+0x1ba/0x300 [btrfs] [<ffffffffa01999f6>] btrfs_relocate_chunk.isra.62+0x56/0x3f0 [btrfs] [<ffffffffa01556b3>] ? block_group_cache_tree_search+0xb3/0xf0 [btrfs] [<ffffffffa018dfe6>] ? release_extent_buffer+0x36/0xe0 [btrfs] [<ffffffffa019c60c>] __btrfs_balance+0x32c/0x420 [btrfs] [<ffffffffa019ca38>] btrfs_balance+0x338/0x5d0 [btrfs] [<ffffffffa019cd54>] balance_kthread+0x84/0x90 [btrfs] [<ffffffffa019ccd0>] ? btrfs_balance+0x5d0/0x5d0 [btrfs] [<ffffffff8108f9a9>] kthread+0xc9/0xe0 [<ffffffff8108f8e0>] ? flush_kthread_worker+0xb0/0xb0 [<ffffffff817665fc>] ret_from_fork+0x7c/0xb0 [<ffffffff8108f8e0>] ? flush_kthread_worker+0xb0/0xb0 Code: ff ff 48 89 df e8 79 cb f8 ff 48 8b bd 48 ff ff ff e8 6d cb f8 ff 48 83 bd 58 ff ff ff 00 0f 84 62 ef ff ff e9 87 fd ff ff 0f 0b <0f> 0b 48 8b 85 20 ff ff ff 49 8d 7f 20 48 8b 70 18 48 89 c2 e8 RIP [<ffffffffa01c04a8>] build_backref_tree+0x1228/0x1290 [btrfs] RSP <ffff8810018a3ab8> ---[ end trace 1b7853634ea4bd18 ]---
=> Crash on 3.15:
[ 1565.477358] BTRFS info (device sdb1): disk space caching is enabled [ 1565.567580] BTRFS: detected SSD devices, enabling SSD mode [ 1565.739226] BTRFS info (device sdb1): continuing balance [ 1565.790228] BTRFS info (device sdb1): relocating block group 82699091968 flags 1 [ 1567.768219] BTRFS info (device sdb1): found 3719 extents [ 1569.597766] ------------[ cut here ]------------ [ 1569.598026] kernel BUG at fs/btrfs/relocation.c:1064! [ 1569.598269] invalid opcode: 0000 [#1] PREEMPT SMP [ 1569.598528] Modules linked in: des_generic nfsv3 nfsv4 fuse autofs4 bnep rfcomm parport_pc ppdev binfmt_misc uvcvideo videobuf2_core videodev media videobuf2_vmalloc videobuf2_memops snd_usb_audio snd_usbmidi_lib ecb btusb bluetooth 6lowpan_iphc snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_controller snd_hda_codec intel_rapl x86_pkg_temp_thermal snd_hwdep snd_pcm_oss snd_mixer_oss snd_pcm intel_powerclamp coretemp rpcsec_gss_krb5 nfsd kvm snd_seq_midi snd_rawmidi snd_seq_midi_event nfs_acl auth_rpcgss snd_seq snd_timer snd_seq_device nfs ehci_pci ehci_hcd hp_wmi crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel tpm_infineon snd sparse_keymap rfkill sb_edac psmouse evdev fscache soundcore lockd edac_core serio_raw lpc_ich wmi aesni_intel processor ablk_helper cryptd lrw gf128mul sunrpc tpm_tis glue_helper tpm aes_x86_64 microcode lp parport loop hid_generic usbhid hid uas usb_storage dm_mod firewire_ohci xhci_hcd firewire_core crc_itu_t usbcore e1000e usb_common isci ptp pps_core libsas scsi_transport_sas [ 1569.602494] CPU: 4 PID: 6244 Comm: btrfs-balance Not tainted 3.15.0-rc5-amd64-i915-preempt-20140216s2 #1 [ 1569.602963] Hardware name: Hewlett-Packard HP Z620 Workstation/158A, BIOS J61 v01.17 11/05/2012 [ 1569.603433] task: ffff880fde596210 ti: ffff880fde598000 task.ti: ffff880fde598000 [ 1569.603898] RIP: 0010:[<ffffffff81267ef0>] [<ffffffff81267ef0>] build_backref_tree+0x9fc/0xcc4 [ 1569.604382] RSP: 0018:ffff880fde599ad8 EFLAGS: 00010246 [ 1569.604622] RAX: ffff880fde599b00 RBX: ffff880806836c10 RCX: ffff8807d8ea74d0 [ 1569.604867] RDX: ffff8808060d9750 RSI: ffff880fde599b58 RDI: ffff8807d8f51e90 [ 1569.605109] RBP: ffff880fde599bb8 R08: ffff88080682c940 R09: 0000000000001000 [ 1569.605352] R10: 0000160000000000 R11: 6db6db6db6db6db7 R12: ffff8807d8f51e90 [ 1569.605598] R13: ffff880fde599b68 R14: ffff880806836bc0 R15: ffff880805f64800 [ 1569.605842] FS: 0000000000000000(0000) GS:ffff88082fc80000(0000) knlGS:0000000000000000 [ 1569.606310] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1569.606550] CR2: 00007fa936051000 CR3: 0000000001c11000 CR4: 00000000000407e0 [ 1569.606791] Stack: [ 1569.607025] ffff8807d8ebc940 ffff8807d8f51820 ffff8807d8ebc940 ffff880807907d00 [ 1569.607512] 01ff881004811580 ffff880fde599b68 ffff880805f64920 0000000000000000 [ 1569.608001] ffff880f00000005 ffff8807d9a78f50 ffff880fde599b58 0000000000000000 [ 1569.608487] Call Trace: [ 1569.608728] [<ffffffff81269bd2>] relocate_tree_blocks+0x16a/0x44c [ 1569.608972] [<ffffffff8126aa03>] relocate_block_group+0x239/0x49a [ 1569.609217] [<ffffffff8126adbf>] btrfs_relocate_block_group+0x15b/0x26d [ 1569.609465] [<ffffffff81249838>] btrfs_relocate_chunk.isra.23+0x5c/0x5e8 [ 1569.609711] [<ffffffff8161efbb>] ? _raw_spin_unlock+0x17/0x2a [ 1569.609955] [<ffffffff81245584>] ? free_extent_buffer+0x8a/0x8d [ 1569.610200] [<ffffffff8124c0be>] btrfs_balance+0x9b6/0xb74 [ 1569.610442] [<ffffffff81615c3d>] ? printk+0x54/0x56 [ 1569.610684] [<ffffffff8124c27c>] ? btrfs_balance+0xb74/0xb74 [ 1569.610928] [<ffffffff8124c2d5>] balance_kthread+0x59/0x7b [ 1569.611173] [<ffffffff8106b467>] kthread+0xae/0xb6 [ 1569.611413] [<ffffffff8106b3b9>] ? __kthread_parkme+0x61/0x61 [ 1569.611664] [<ffffffff81625b3c>] ret_from_fork+0x7c/0xb0 [ 1569.611905] [<ffffffff8106b3b9>] ? __kthread_parkme+0x61/0x61 [ 1569.612149] Code: 0d 48 89 df e8 f4 e7 ff ff 41 80 66 71 fd 49 8b 46 58 4d 89 66 58 49 89 1c 24 49 89 44 24 08 4c 89 20 e9 80 00 00 00 a8 10 75 02 <0f> 0b 83 e0 01 39 85 78 ff ff ff 74 02 0f 0b 83 bd 78 ff ff ff [ 1569.613240] RIP [<ffffffff81267ef0>] build_backref_tree+0x9fc/0xcc4 [ 1569.613491] RSP <ffff880fde599ad8> [ 1569.614119] ---[ end trace da0f24875bbde960 ]--- [ 1569.614398] Kernel panic - not syncing: Fatal exception [ 1569.614738] Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffff9fffffff) [ 1569.615245] ---[ end Kernel panic - not syncing: Fatal exception
Signature · 4 lines
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
.... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/ Quoted 6 lines · On Mon, 9 Jun 2014 16:40:07 Marc MERLIN wrote:
I did a balance on a system that had 3.11 (yes, I know, it's old). It hung. So, I rebooted with 3.13, and it failed in
fs/btrfs/relocationProblem #1: I cannot stop the relocation. It starts on its own as soon as I mount the FS, and I can't stop it.
Is there a bug to fix that?
The skip_balance mount option prevents a balance from being continued. On all my systems I have rootflags=skip_balance in the GRUB configuration because so far I have never had a system reboot during a balance for any reason other than a system crash caused by the balance.
I think it would be good to have a program comparable to tune2fs that allows us to set the state of such things. It would be a lot easier than modifying boot loader configuration on lots of systems.
Also rootflags=skip_balance will abort the boot if you run kernel 3.2.0 and that caused me some annoyance when I applied it to all systems including the one with a stock Debian/Wheezy configuration.
Signature · 2 lines
My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/
Quoted 4 lines · Russell Coker
Quoted 3 lines · On Mon, 9 Jun 2014 16:40:07 Marc MERLIN wrote:
I did a balance on a system that had 3.11 (yes, I know, it's old). It hung. So, I rebooted with 3.13, and it failed in
fs/btrfs/relocation
Quoted 8 lines
Quoted 3 lines
Problem #1: I cannot stop the relocation. It starts on its own as soon as I mount the FS, and I can't stop it.
Is there a bug to fix that?The
skip_balancemount option prevents a balance from being continued. On all my systems I have rootflags=skip_balance in the GRUB configuration because so far I have never had a system reboot during a balance for any reason other than a system crash caused by the balance.
Aaah, good idea, thank you.
Quoted 3 lines
I think it would be good to have a program comparable to tune2fs that allows us to set the state of such things. It would be a lot easier than modifying boot loader configuration on lots of systems.
Totally agreed.
I'll still wait a bit to see if someone wants me to provide more info from the FS, but having balance crash the system and hard lock it, is indeed not good.
Thanks,
Marc
Signature · 4 lines
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
.... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/ | PGP 1024R/763BE901Quoted 6 lines · Marc MERLIN
I did a balance on a system that had 3.11 (yes, I know, it's old). It hung. So, I rebooted with 3.13, and it failed in
fs/btrfs/relocationProblem #1: I cannot stop the relocation. It starts on its own as soon as I mount the FS, and I can't stop it.
Is there a bug to fix that?
Chris,
As Russell pointed out, I can stop the balance at mount, but back to the bug, can you make btrfs not crash like this if it gets input it doesn't expect?
Separately, I'll send one lsat offer to give data off the FS to give you a chance to figure out how it got into that state and potentially find another bug.
That is unless there were one or more known corruption bugs that have been fixed and that there is nothing to be learned from looking into this.
Thanks,
Marc
Quoted 141 lines
Problem #2: I rebooted with 3.15rc5, and now it's worse.
[ 1569.598026] kernel BUG at fs/btrfs/relocation.c:1064! then leads to [ 1569.613240] RIP [<ffffffff81267ef0>] build_backref_tree+0x9fc/0xcc4 [ 1569.613491] RSP <ffff880fde599ad8> [ 1569.614119] ---[ end trace da0f24875bbde960 ]--- [ 1569.614398] Kernel panic - not syncing: Fatal exception(full trace below)
I'm sure that filesystem is damaged in some way, but the kernel of course should not crash.
3.15 dies here:
structbackref_node*build_backref_tree(structreloc_control*rc, (...)if (!RB_EMPTY_NODE(&upper->rb_node)) { if (upper->lowest) { list_del_init(&upper->lower); upper->lowest = 0; } list_add_tail(&edge->list[UPPER], &upper->lower); continue; } BUG_ON(!upper->checked); <<<< hereSo I'm sure I hit a bug and my FS has issues, but can't the kernel do something better like abort the rebalance instead of crashing?
In the meantime, does anyone want anything off that filesystem before I wipe it?
=> Crash on 3.13:
btrfs: found 4930 extents
btrfs: relocating block group 82699091968 flags 1
btrfs: found 3719 extents------------[ cut here ]------------ kernel BUG at /build/buildd/linux-lts-trusty-3.13.0/fs/btrfs/relocation.c:1062! invalid opcode: 0000 [#1] SMP Modules linked in: rfcomm parport_pc ppdev bnep binfmt_misc rpcsec_gss_krb5 nfsd nfs_acl auth_rpcgss nfs fscache lockd sunrpc snd_hda_codec_hdmi nvidia(POF) snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_usb_audio snd_pcm snd_hwdep snd_usbmidi_lib snd_seq_midi snd_seq_midi_event snd_seq btusb bluetooth uvcvideo videobuf2_core videodev videobuf2_vmalloc videobuf2_memops snd_rawmidi snd_timer snd_seq_device drm snd psmouse gpio_ich sb_edac hp_wmi serio_raw edac_core mei_me mei mac_hid soundcore sparse_keymap snd_page_alloc lpc_ich wmi tpm_infineon lp parport btrfs raid6_pq xor libcrc32c hid_generic usbhid hid usb_storage firewire_ohci isci e1000e firewire_core libsas crc_itu_t ptp ahci libahci pps_core scsi_transport_sas CPU: 4 PID: 1710 Comm: btrfs-balance Tainted: PF O 3.13.0-29-generic #53~precise1-Ubuntu Hardware name: Hewlett-Packard HP Z620 Workstation/158A, BIOS J61 v01.17 11/05/2012 task: ffff881000bec7d0 ti: ffff8810018a2000 task.ti: ffff8810018a2000 RIP: 0010:[<ffffffffa01c04a8>] [<ffffffffa01c04a8>] build_backref_tree+0x1228/0x1290 [btrfs] RSP: 0018:ffff8810018a3ab8 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff880801a8fa20 RCX: ffff880801d2cf50 RDX: ffff880801d2c390 RSI: ffff880801d2c640 RDI: ffff8807ecad9c80 RBP: ffff8810018a3bb8 R08: ffff8807ecad9c80 R09: 0000000000000001 R10: 0000000000000001 R11: 0000000000000000 R12: ffff880801d2c650 R13: ffff8807ecad9900 R14: 0000000000000000 R15: ffff88003582a800 FS: 0000000000000000(0000) GS:ffff88080fc80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f10ee50a370 CR3: 0000000001c0d000 CR4: 00000000000407e0 Stack: ffff8807ecad9780 01ffffffa01bded0 ffff880801d2c620 ffff88003582a920 ffff8807ecad9c80 ffff8807ff72e800 ffff8807ecad9240 ffff8807ecad9200 ffff880801a8fa20 ffff880801a8fab0 ffff88003582a924 ffff88003582a820 Call Trace: [<ffffffffa01c064b>] relocate_tree_blocks+0x13b/0x1e0 [btrfs] [<ffffffffa01c12b9>] relocate_block_group+0x199/0x550 [btrfs] [<ffffffffa01c182a>] btrfs_relocate_block_group+0x1ba/0x300 [btrfs] [<ffffffffa01999f6>] btrfs_relocate_chunk.isra.62+0x56/0x3f0 [btrfs] [<ffffffffa01556b3>] ? block_group_cache_tree_search+0xb3/0xf0 [btrfs] [<ffffffffa018dfe6>] ? release_extent_buffer+0x36/0xe0 [btrfs] [<ffffffffa019c60c>] __btrfs_balance+0x32c/0x420 [btrfs] [<ffffffffa019ca38>] btrfs_balance+0x338/0x5d0 [btrfs] [<ffffffffa019cd54>] balance_kthread+0x84/0x90 [btrfs] [<ffffffffa019ccd0>] ? btrfs_balance+0x5d0/0x5d0 [btrfs] [<ffffffff8108f9a9>] kthread+0xc9/0xe0 [<ffffffff8108f8e0>] ? flush_kthread_worker+0xb0/0xb0 [<ffffffff817665fc>] ret_from_fork+0x7c/0xb0 [<ffffffff8108f8e0>] ? flush_kthread_worker+0xb0/0xb0 Code: ff ff 48 89 df e8 79 cb f8 ff 48 8b bd 48 ff ff ff e8 6d cb f8 ff 48 83 bd 58 ff ff ff 00 0f 84 62 ef ff ff e9 87 fd ff ff 0f 0b <0f> 0b 48 8b 85 20 ff ff ff 49 8d 7f 20 48 8b 70 18 48 89 c2 e8 RIP [<ffffffffa01c04a8>] build_backref_tree+0x1228/0x1290 [btrfs] RSP <ffff8810018a3ab8> ---[ end trace 1b7853634ea4bd18 ]---=> Crash on 3.15:
[ 1565.477358] BTRFS info (device sdb1): disk space caching is enabled [ 1565.567580] BTRFS: detected SSD devices, enabling SSD mode [ 1565.739226] BTRFS info (device sdb1): continuing balance [ 1565.790228] BTRFS info (device sdb1): relocating block group 82699091968 flags 1 [ 1567.768219] BTRFS info (device sdb1): found 3719 extents [ 1569.597766] ------------[ cut here ]------------ [ 1569.598026] kernel BUG at fs/btrfs/relocation.c:1064! [ 1569.598269] invalid opcode: 0000 [#1] PREEMPT SMP [ 1569.598528] Modules linked in: des_generic nfsv3 nfsv4 fuse autofs4 bnep rfcomm parport_pc ppdev binfmt_misc uvcvideo videobuf2_core videodev media videobuf2_vmalloc videobuf2_memops snd_usb_audio snd_usbmidi_lib ecb btusb bluetooth 6lowpan_iphc snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_controller snd_hda_codec intel_rapl x86_pkg_temp_thermal snd_hwdep snd_pcm_oss snd_mixer_oss snd_pcm intel_powerclamp coretemp rpcsec_gss_krb5 nfsd kvm snd_seq_midi snd_rawmidi snd_seq_midi_event nfs_acl auth_rpcgss snd_seq snd_timer snd_seq_device nfs ehci_pci ehci_hcd hp_wmi crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel tpm_infineon snd sparse_keymap rfkill sb_edac psmouse evdev fscache soundcore lockd edac_core serio_raw lpc_ich wmi aesni_intel processor ablk_helper cryptd lrw gf128mul sunrpc tpm_tis glue_helper tpm aes_x86_64 microcode lp parport loop hid_generic usbhid hid uas usb_storage dm_mod firewire_ohci xhci_hcd firewire_core crc_itu_t usbcore e1000e usb_common isci ptp pps_core libsas scsi_transport_sas [ 1569.602494] CPU: 4 PID: 6244 Comm: btrfs-balance Not tainted 3.15.0-rc5-amd64-i915-preempt-20140216s2 #1 [ 1569.602963] Hardware name: Hewlett-Packard HP Z620 Workstation/158A, BIOS J61 v01.17 11/05/2012 [ 1569.603433] task: ffff880fde596210 ti: ffff880fde598000 task.ti: ffff880fde598000 [ 1569.603898] RIP: 0010:[<ffffffff81267ef0>] [<ffffffff81267ef0>] build_backref_tree+0x9fc/0xcc4 [ 1569.604382] RSP: 0018:ffff880fde599ad8 EFLAGS: 00010246 [ 1569.604622] RAX: ffff880fde599b00 RBX: ffff880806836c10 RCX: ffff8807d8ea74d0 [ 1569.604867] RDX: ffff8808060d9750 RSI: ffff880fde599b58 RDI: ffff8807d8f51e90 [ 1569.605109] RBP: ffff880fde599bb8 R08: ffff88080682c940 R09: 0000000000001000 [ 1569.605352] R10: 0000160000000000 R11: 6db6db6db6db6db7 R12: ffff8807d8f51e90 [ 1569.605598] R13: ffff880fde599b68 R14: ffff880806836bc0 R15: ffff880805f64800 [ 1569.605842] FS: 0000000000000000(0000) GS:ffff88082fc80000(0000) knlGS:0000000000000000 [ 1569.606310] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1569.606550] CR2: 00007fa936051000 CR3: 0000000001c11000 CR4: 00000000000407e0 [ 1569.606791] Stack: [ 1569.607025] ffff8807d8ebc940 ffff8807d8f51820 ffff8807d8ebc940 ffff880807907d00 [ 1569.607512] 01ff881004811580 ffff880fde599b68 ffff880805f64920 0000000000000000 [ 1569.608001] ffff880f00000005 ffff8807d9a78f50 ffff880fde599b58 0000000000000000 [ 1569.608487] Call Trace: [ 1569.608728] [<ffffffff81269bd2>] relocate_tree_blocks+0x16a/0x44c [ 1569.608972] [<ffffffff8126aa03>] relocate_block_group+0x239/0x49a [ 1569.609217] [<ffffffff8126adbf>] btrfs_relocate_block_group+0x15b/0x26d [ 1569.609465] [<ffffffff81249838>] btrfs_relocate_chunk.isra.23+0x5c/0x5e8 [ 1569.609711] [<ffffffff8161efbb>] ? _raw_spin_unlock+0x17/0x2a [ 1569.609955] [<ffffffff81245584>] ? free_extent_buffer+0x8a/0x8d [ 1569.610200] [<ffffffff8124c0be>] btrfs_balance+0x9b6/0xb74 [ 1569.610442] [<ffffffff81615c3d>] ? printk+0x54/0x56 [ 1569.610684] [<ffffffff8124c27c>] ? btrfs_balance+0xb74/0xb74 [ 1569.610928] [<ffffffff8124c2d5>] balance_kthread+0x59/0x7b [ 1569.611173] [<ffffffff8106b467>] kthread+0xae/0xb6 [ 1569.611413] [<ffffffff8106b3b9>] ? __kthread_parkme+0x61/0x61 [ 1569.611664] [<ffffffff81625b3c>] ret_from_fork+0x7c/0xb0 [ 1569.611905] [<ffffffff8106b3b9>] ? __kthread_parkme+0x61/0x61 [ 1569.612149] Code: 0d 48 89 df e8 f4 e7 ff ff 41 80 66 71 fd 49 8b 46 58 4d 89 66 58 49 89 1c 24 49 89 44 24 08 4c 89 20 e9 80 00 00 00 a8 10 75 02 <0f> 0b 83 e0 01 39 85 78 ff ff ff 74 02 0f 0b 83 bd 78 ff ff ff [ 1569.613240] RIP [<ffffffff81267ef0>] build_backref_tree+0x9fc/0xcc4 [ 1569.613491] RSP <ffff880fde599ad8> [ 1569.614119] ---[ end trace da0f24875bbde960 ]--- [ 1569.614398] Kernel panic - not syncing: Fatal exception [ 1569.614738] Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffff9fffffff) [ 1569.615245] ---[ end Kernel panic - not syncing: Fatal exceptionSignature · 8 lines
"A mouse is a device used to point at the xterm you want to type in" - A.S.R. Microsoft is to operating systems .... .... what McDonalds is to gourmet cooking Home page: http://marc.merlins.org/ -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 4 lines
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
.... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/ | PGP 1024R/763BE901Quoted 14 lines · Marc MERLIN
I did a balance on a system that had 3.11 (yes, I know, it's old). It hung. So, I rebooted with 3.13, and it failed in
fs/btrfs/relocationProblem #1: I cannot stop the relocation. It starts on its own as soon as I mount the FS, and I can't stop it.
Is there a bug to fix that?Problem #2: I rebooted with 3.15rc5, and now it's worse.
[ 1569.598026] kernel BUG at fs/btrfs/relocation.c:1064! then leads to [ 1569.613240] RIP [<ffffffff81267ef0>] build_backref_tree+0x9fc/0xcc4 [ 1569.613491] RSP <ffff880fde599ad8> [ 1569.614119] ---[ end trace da0f24875bbde960 ]--- [ 1569.614398] Kernel panic - not syncing: Fatal exception
Quoted 5 lines
(full trace below)
I'm sure that filesystem is damaged in some way, but the kernel of course should not crash.
I don't have this mail client setup right to send patches, can you just go into relocation.c in build_backref_tree and remove the need_check = false; statement and see if that fixes it. Thanks,
Josef
Quoted 7 lines · Josef Bacik
Quoted 3 lines
I'm sure that filesystem is damaged in some way, but the kernel of course should not crash.
I don't have this mail client setup right to send patches, can you just go into
relocation.cinbuild_backref_treeand remove theneed_check= false; statement and see if that fixes it. Thanks,
Sure, I'll try that tomorrow when I have access to that machine.
Just to be clear
1) You mean this one, right?
if (!upper->checked && need_check) {
need_check = false; <-- delete this
list_add_tail(&edge->list[UPPER],
&list);
} else2) is your guess that the BUG_ON I'm getting shouldn't be triggered and your proposed patch could fix that, or that I do have an FS problem but that we're just going to make the kernel more lenient and not crash on it?
Thanks,
Marc
Signature · 4 lines
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
.... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/ Quoted 11 lines · Marc MERLIN
Quoted 7 lines · Josef Bacik
Quoted 3 lines
I'm sure that filesystem is damaged in some way, but the kernel of course should not crash.
I don't have this mail client setup right to send patches, can you just go into
relocation.cinbuild_backref_treeand remove theneed_check= false; statement and see if that fixes it. Thanks,Sure, I'll try that tomorrow when I have access to that machine.
Quoted 8 lines
Just to be clear
1) You mean this one, right?if (!upper->checked && need_check) { need_check = false; <-- delete this list_add_tail(&edge->list[UPPER], &list); } else
Yup that one.
Quoted 4 lines
2) is your guess that the
BUG_ONI'm getting shouldn't be triggered and your proposed patch could fix that, or that I do have an FS problem but that we're just going to make the kernel more lenient and not crash on it?
All of these BUG_ON(!uppper->checked) are logic errors, not problems with the fs, which is why I haven't turned them into an abort or something else yet. I'm thinking about chucking this whole function anyway and using the backref walking code, but that is going to be a job for future josef, present josef doesn't seem to have any time to do anything despite sleeping a lot less. Thanks,
Josef
First thanks for your answer and patch. While they didn't help, I'm happy to try another one or two if you'd like before I wipe the FS to recover.
Quoted 8 lines · Josef Bacik
Quoted 5 lines
2) is your guess that the
BUG_ONI'm getting shouldn't be triggered and your proposed patch could fix that, or that I do have an FS problem but that we're just going to make the kernel more lenient and not crash on it?All of these
BUG_ON(!uppper->checked)are logic errors, not problems with the fs, which is why I haven't turned them into an abort or
I'm guessing you saw the comment from someone else in the other thread. BUG_ON is not helpful when you have end users. It effectively crashes the system when it can be unnecessary (a very secondary filesystem you don't depend on), and it tells users that anything wrong with btrfs on any filesystem can take their entire machine down needlessly
(not counting the fact of course that it makes bug reporting on the list that much harder since syslog has no chance to capture and forward it)
Can I appeal to you to remove all the ones you work with? If something is wrong, it should mount the FS read only and/or make it unaccessible, but not crash the entire system.
Quoted 4 lines
something else yet. I'm thinking about chucking this whole function anyway and using the backref walking code, but that is going to be a job for future josef, present josef doesn't seem to have any time to do anything despite sleeping a lot less. Thanks,
Yes, I understand that part. Good luck with getting sleep indeed.
Back to your patch, unfortunately, it did not help.
Let me know if you'd like me to try one more patch or two before I wipe the FS and start over.
But for my own sanity, can you explain if I'm hitting reallocate bugs, or whether my filesystem is indeed correct?
Thanks,
Marc
It crashed on another BUG_ON
if (!list_empty(&cur->upper)) {
/*
* the backref was added previously when processing
* backref of type BTRFS_TREE_BLOCK_REF_KEY
*/
BUG_ON(!list_is_singular(&cur->upper));
edge = list_entry(cur->upper.next, struct backref_edge,
list[LOWER]);
HERE -> BUG_ON(!list_empty(&edge->list[UPPER]));
exist = edge->node[UPPER];
/*
* add the upper level block to pending list if we need
* check its backrefs
*/
if (!exist->checked)[ 209.223856] BTRFS info (device sdb1): disk space caching is enabled [ 209.283364] BTRFS: detected SSD devices, enabling SSD mode [ 209.369267] BTRFS: checking UUID tree [ 209.369286] BTRFS info (device sdb1): continuing balance [ 209.412421] BTRFS info (device sdb1): relocating block group 82699091968 flags 1 [ 211.148796] BTRFS info (device sdb1): found 3719 extents [ 213.351917] ------------[ cut here ]------------ [ 213.351941] kernel BUG at fs/btrfs/relocation.c:752! [ 213.351951] invalid opcode: 0000 [#1] PREEMPT SMP [ 213.351974] 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 uvcvideo videobuf2_core videodev snd_usb_audio media snd_usbmidi_lib videobuf2_vmalloc videobuf2_memops hid_generic usbhid hid ecb btusb bluetooth rpcsec_gss_krb5 6lowpan_iphc nfsd nfs_acl auth_rpcgss nfs fscache snd_hda_codec_hdmi lockd sunrpc snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_controller snd_hda_codec intel_rapl x86_pkg_temp_thermal intel_powerclamp snd_hwdep snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_midi coretemp snd_rawmidi snd_seq_midi_event kvm snd_seq snd_timer crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel snd_seq_device snd aesni_intel sb_edac edac_core soundcore ehci_pci tpm_infineon ablk_helper cryptd lrw ehci_hcd gf128mul glue_helper hp_wmi sparse_keymap rfkill aes_x86_64 tpm_tis lpc_ich psmouse serio_raw tpm evdev microcode processor wmi lp parport loop uas usb_storage dm_mod firewire_ohci xhci_hcd firewire_core crc_itu_t usbcore isci usb_common e1000e libsas ptp pps_core scsi_transport_sas [ 213.352787] CPU: 4 PID: 13538 Comm: btrfs-balance Not tainted 3.15.1-amd64-i915-preempt-20140216jbp #1 [ 213.352795] Hardware name: Hewlett-Packard HP Z620 Workstation/158A, BIOS J61 v01.17 11/05/2012 [ 213.352881] task: ffff8800c9e30510 ti: ffff8807bc6ec000 task.ti: ffff8807bc6ec000 [ 213.352885] RIP: 0010:[<ffffffff812679c1>] [<ffffffff812679c1>] build_backref_tree+0x174/0xcbe [ 213.352894] RSP: 0018:ffff8807bc6efae0 EFLAGS: 00010283 [ 213.352897] RAX: ffff8807dd60b980 RBX: ffff8800c6f6a890 RCX: ffff8807dd60b990 [ 213.352900] RDX: ffff8807bc6efb58 RSI: 0000000000000000 RDI: 0000000000000000 [ 213.352903] RBP: ffff8807bc6efbb8 R08: ffff8807bc6efa9c R09: ffff8807bc6ef9d8 [ 213.352906] R10: ffff8800c6c3ee50 R11: 0000000000000000 R12: ffff88080329c000 [ 213.352909] R13: ffff8800354ae1c0 R14: ffff8800c6f6a890 R15: ffff880804ff6000 [ 213.352912] FS: 0000000000000000(0000) GS:ffff88082fc80000(0000) knlGS:0000000000000000 [ 213.352915] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 213.352918] CR2: 00007f182f620000 CR3: 0000000001c13000 CR4: 00000000000407e0 [ 213.352921] Stack: [ 213.352924] ffff8807dd60bac0 ffff8807c4fd8e50 ffff8800c69e6fa0 ffff880804ff6124 [ 213.352935] ffff8800354ae200 ffff8807bc6efb68 ffff880804ff6120 ffff88003549dac0 [ 213.352950] 0000000000000003 ffff8807bc6efb58 ffff8800c6f6a800 ffff8800c6f6a890 [ 213.352961] Call Trace: [ 213.352967] [<ffffffff81269f25>] relocate_tree_blocks+0x16a/0x44c [ 213.352971] [<ffffffff8126ad56>] relocate_block_group+0x239/0x49a [ 213.352975] [<ffffffff8126b112>] btrfs_relocate_block_group+0x15b/0x26d [ 213.352981] [<ffffffff81249b80>] btrfs_relocate_chunk.isra.23+0x5c/0x5e8 [ 213.352987] [<ffffffff8161faeb>] ? _raw_spin_unlock+0x17/0x2a [ 213.352991] [<ffffffff812458cc>] ? free_extent_buffer+0x8a/0x8d [ 213.352995] [<ffffffff8124c406>] btrfs_balance+0x9b6/0xb74 [ 213.352999] [<ffffffff8161676d>] ? printk+0x54/0x56 [ 213.353003] [<ffffffff8124c5c4>] ? btrfs_balance+0xb74/0xb74 [ 213.353007] [<ffffffff8124c61d>] balance_kthread+0x59/0x7b [ 213.353012] [<ffffffff8106b4b4>] kthread+0xae/0xb6 [ 213.353015] [<ffffffff8106b406>] ? __kthread_parkme+0x61/0x61 [ 213.353020] [<ffffffff8162667c>] ret_from_fork+0x7c/0xb0 [ 213.353024] [<ffffffff8106b406>] ? __kthread_parkme+0x61/0x61 [ 213.353027] Code: e8 de 84 de ff 49 8d 45 40 48 89 c1 48 89 85 48 ff ff ff 49 8b 45 40 48 39 c8 74 38 49 3b 45 48 0f 85 25 0b 00 00 e9 22 0b 00 00 <0f> 0b 4c 8b 70 28 41 f6 46 71 10 75 1f 48 8b 4d a8 48 8b 9d 70 [ 213.353203] RIP [<ffffffff812679c1>] build_backref_tree+0x174/0xcbe [ 213.353208] RSP <ffff8807bc6efae0> [ 213.353213] ---[ end trace 07cbfc43e0fb0ccd ]--- [ 213.353216] Kernel panic - not syncing: Fatal exception [ 213.353258] Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffff9fffffff) [ 213.353262] ---[ end Kernel panic - not syncing: Fatal exception
Signature · 4 lines
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
.... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/ Quoted 60 lines · Marc MERLIN
First thanks for your answer and patch. While they didn't help, I'm happy to try another one or two if you'd like before I wipe the FS to recover.
Quoted 8 lines · Josef Bacik
Quoted 5 lines
2) is your guess that the
BUG_ONI'm getting shouldn't be triggered and your proposed patch could fix that, or that I do have an FS problem but that we're just going to make the kernel more lenient and not crash on it?All of these
BUG_ON(!uppper->checked)are logic errors, not problems with the fs, which is why I haven't turned them into an abort orI'm guessing you saw the comment from someone else in the other thread.
BUG_ONis not helpful when you have end users. It effectively crashes the system when it can be unnecessary (a very secondary filesystem you don't depend on), and it tells users that anything wrong with btrfs on any filesystem can take their entire machine down needlessly
(not counting the fact of course that it makes bug reporting on the list that much harder since syslog has no chance to capture and forward it)Can I appeal to you to remove all the ones you work with? If something is wrong, it should mount the FS read only and/or make it unaccessible, but not crash the entire system.
Quoted 4 lines
something else yet. I'm thinking about chucking this whole function anyway and using the backref walking code, but that is going to be a job for future josef, present josef doesn't seem to have any time to do anything despite sleeping a lot less. Thanks,
Yes, I understand that part. Good luck with getting sleep indeed.
Back to your patch, unfortunately, it did not help.
Let me know if you'd like me to try one more patch or two before I wipe the FS and start over.
But for my own sanity, can you explain if I'm hitting reallocate bugs, or whether my filesystem is indeed correct?Thanks,
MarcIt crashed on another
BUG_ONif (!list_empty(&cur->upper)) { /* * the backref was added previously when processing * backref of type BTRFS_TREE_BLOCK_REF_KEY */ BUG_ON(!list_is_singular(&cur->upper)); edge = list_entry(cur->upper.next, struct backref_edge, list[LOWER]); HERE -> BUG_ON(!list_empty(&edge->list[UPPER])); exist = edge->node[UPPER]; /* * add the upper level block to pending list if we need * check its backrefs */ if (!exist->checked)
Quoted 10 lines
[ 209.223856] BTRFS info (device sdb1): disk space caching is enabled [ 209.283364] BTRFS: detected SSD devices, enabling SSD mode [ 209.369267] BTRFS: checking UUID tree [ 209.369286] BTRFS info (device sdb1): continuing balance [ 209.412421] BTRFS info (device sdb1): relocating block group 82699091968 flags 1 [ 211.148796] BTRFS info (device sdb1): found 3719 extents [ 213.351917] ------------[ cut here ]------------ [ 213.351941] kernel BUG at fs/btrfs/relocation.c:752! [ 213.351951] invalid opcode: 0000 [#1] PREEMPT SMP [ 213.351974] 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 uvcvideo videobuf2_core videodev snd_usb_audio media snd_usbmidi_lib videobuf2_vmalloc videobuf2_memops hid_generic usbhid hid ecb btusb bluetooth rpcsec_gss_krb5 6lowpan_iphc nfsd nfs_acl auth_rpcgss nfs fscache snd_hda_codec_hdmi lockd sunrpc snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_controller snd_hda_codec intel_rapl x86_pkg_temp_thermal intel_powerclamp snd_hwdep snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_midi coretemp snd_rawmidi snd_seq_midi_event kvm snd_seq snd_timer crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel snd_seq_device snd aesni_intel sb_edac edac_core soundcore ehci_pci tpm_infineon ablk_helper cryptd lrw ehci_hcd gf128mul glue_helper hp_wmi sparse_keymap rfkill aes_x86_64 tpm_tis lpc_ich p
smouse serio_raw tpm evdev microcode processor wmi lp parport loop uas usb_storage dm_mod firewire_ohci xhci_hcd firewire_core crc_itu_t usbcore isci usb_common e1000e libsas ptp pps_core scsi_transport_sas
Quoted 31 lines
[ 213.352787] CPU: 4 PID: 13538 Comm: btrfs-balance Not tainted 3.15.1-amd64-i915-preempt-20140216jbp #1 [ 213.352795] Hardware name: Hewlett-Packard HP Z620 Workstation/158A, BIOS J61 v01.17 11/05/2012 [ 213.352881] task: ffff8800c9e30510 ti: ffff8807bc6ec000 task.ti: ffff8807bc6ec000 [ 213.352885] RIP: 0010:[<ffffffff812679c1>] [<ffffffff812679c1>] build_backref_tree+0x174/0xcbe [ 213.352894] RSP: 0018:ffff8807bc6efae0 EFLAGS: 00010283 [ 213.352897] RAX: ffff8807dd60b980 RBX: ffff8800c6f6a890 RCX: ffff8807dd60b990 [ 213.352900] RDX: ffff8807bc6efb58 RSI: 0000000000000000 RDI: 0000000000000000 [ 213.352903] RBP: ffff8807bc6efbb8 R08: ffff8807bc6efa9c R09: ffff8807bc6ef9d8 [ 213.352906] R10: ffff8800c6c3ee50 R11: 0000000000000000 R12: ffff88080329c000 [ 213.352909] R13: ffff8800354ae1c0 R14: ffff8800c6f6a890 R15: ffff880804ff6000 [ 213.352912] FS: 0000000000000000(0000) GS:ffff88082fc80000(0000) knlGS:0000000000000000 [ 213.352915] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 213.352918] CR2: 00007f182f620000 CR3: 0000000001c13000 CR4: 00000000000407e0 [ 213.352921] Stack: [ 213.352924] ffff8807dd60bac0 ffff8807c4fd8e50 ffff8800c69e6fa0 ffff880804ff6124 [ 213.352935] ffff8800354ae200 ffff8807bc6efb68 ffff880804ff6120 ffff88003549dac0 [ 213.352950] 0000000000000003 ffff8807bc6efb58 ffff8800c6f6a800 ffff8800c6f6a890 [ 213.352961] Call Trace: [ 213.352967] [<ffffffff81269f25>] relocate_tree_blocks+0x16a/0x44c [ 213.352971] [<ffffffff8126ad56>] relocate_block_group+0x239/0x49a [ 213.352975] [<ffffffff8126b112>] btrfs_relocate_block_group+0x15b/0x26d [ 213.352981] [<ffffffff81249b80>] btrfs_relocate_chunk.isra.23+0x5c/0x5e8 [ 213.352987] [<ffffffff8161faeb>] ? _raw_spin_unlock+0x17/0x2a [ 213.352991] [<ffffffff812458cc>] ? free_extent_buffer+0x8a/0x8d [ 213.352995] [<ffffffff8124c406>] btrfs_balance+0x9b6/0xb74 [ 213.352999] [<ffffffff8161676d>] ? printk+0x54/0x56 [ 213.353003] [<ffffffff8124c5c4>] ? btrfs_balance+0xb74/0xb74 [ 213.353007] [<ffffffff8124c61d>] balance_kthread+0x59/0x7b [ 213.353012] [<ffffffff8106b4b4>] kthread+0xae/0xb6 [ 213.353015] [<ffffffff8106b406>] ? __kthread_parkme+0x61/0x61 [ 213.353020] [<ffffffff8162667c>] ret_from_fork+0x7c/0xb0
Quoted 9 lines
[ 213.353024] [<ffffffff8106b406>] ? __kthread_parkme+0x61/0x61 [ 213.353027] Code: e8 de 84 de ff 49 8d 45 40 48 89 c1 48 89 85 48 ff ff ff 49 8b 45 40 48 39 c8 74 38 49 3b 45 48 0f 85 25 0b 00 00 e9 22 0b 00 00 <0f> 0b 4c 8b 70 28 41 f6 46 71 10 75 1f 48 8b 4d a8 48 8b 9d 70 [ 213.353203] RIP [<ffffffff812679c1>] build_backref_tree+0x174/0xcbe [ 213.353208] RSP <ffff8807bc6efae0> [ 213.353213] ---[ end trace 07cbfc43e0fb0ccd ]--- [ 213.353216] Kernel panic - not syncing: Fatal exception [ 213.353258] Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffff9fffffff) [ 213.353262] ---[ end Kernel panic - not syncing: Fatal exception
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,
Josef
fs/btrfs/relocation.c +15 -3
@@ -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) {
Quoted 9 lines · Josef Bacik
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 betweenrunning
build_backref_tree
<some shit>
block <some more shit> wasn't checked
done building backref tree
Quoted 4 lines
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 evdev 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
Signature · 4 lines
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
.... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/ Quoted 10 lines · Marc MERLIN
Quoted 9 lines · Josef Bacik
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 betweenrunning
build_backref_tree
<some shit>
block <some more shit> wasn't checked
done building backref tree
Quoted 7 lines
Quoted 4 lines
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:
Ok same drill as before, reset and apply this, hopefully no panic this time
fs/btrfs/relocation.c +32 -4
@@ -440,7 +440,7 @@ static void remove_backref_node(struct backref_cache *cache,free_backref_edge (cache, edge);if (RB_EMPTY_NODE (&upper->rb_node)) { -BUG_ON (!list_empty (&node->upper)); +// BUG_ON(!list_empty(&node->upper)); drop_backref_node (cache, node); node = upper; node->lowest =1 ;
@@ -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,8 @@ struct backref_node *build_backref_tree(struct reloc_control *rc, node->lowest =1 ; cur = node; again: +printk (KERN_ERR "building backref for bytenr %llu level %d\n" , + cur->bytenr, cur->level); end =0 ; ptr =0 ; key.objectid = cur->bytenr;
@@ -757,6 +760,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 +869,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);
@@ -958,14 +963,30 @@ again: &root->state)) upper->cowonly =1 ; +printk (KERN_ERR "eb in path %llu, level %d, " +"cowonly %d, owner %llu, gen %llu, last " +"snap %llu, reloc %d, root %llu\n" , + upper->bytenr, upper->level, + upper->cowonly, upper->owner, +btrfs_header_generation (eb), +btrfs_root_last_snapshot (&root->root_item), +btrfs_header_flag (eb, +BTRFS_HEADER_FLAG_RELOC ), + root->objectid); +/* * 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 "is shared, need_check" +" %d\n" , need_check); upper->checked =0 ; -else + }else { +printk (KERN_ERR "isn't shared, " +"need_check %d\n" , need_check); upper->checked =1 ; + }/* * add the block to pending list if we
@@ -1019,6 +1040,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 +1084,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 +1141,7 @@ next: } } out: +printk (KERN_ERR "done building backref tree\n" );btrfs_free_path (path1);btrfs_free_path (path2);if (err) {
fs/btrfs/relocation.c
Quoted 5 lines · Josef Bacik
Ok same drill as before, reset and apply this, hopefully no panic this time
fs/btrfs/relocation.c +0
-0
Here's the output
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 level 0
eb in path 173444124672, level 1, cowonly 0, owner 256, gen 231481, last snap 243545, reloc 0, root 256 is shared, need_check 1
eb in path 67327229952, level 2, cowonly 0, owner 256, gen 243615, last snap 243545, reloc 0, root 256 isn't shared, need_check 0
eb in path 2176913408, level 3, cowonly 0, owner 256, gen 253956, last snap 243545, reloc 1, root 256 is shared, need_check 0
eb in path 2320281600, level 4, cowonly 0, owner 256, gen 253957, last snap 243545, reloc 0, root 256 isn't shared, need_check 0
doing the checking for block 173444124672
building backref for bytenr 173444124672 level 1
exist is 67327229952, checked 1
found shared ref 173244198912, needs checking
doing the checking for block 173244198912
building backref for bytenr 173244198912 level 2
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 level 3
eb in path 2314657792, level 4, cowonly 0, owner 6125, gen 253957, last snap 243545, reloc 0, root 6125 isn't shared, need_check 1
doing the checking for block 2177081344
building backref for bytenr 2177081344 level 3
eb in path 2320146432, level 4, cowonly 0, owner 6123, gen 253957, last snap 243338, reloc 0, root 6123 isn't shared, need_check 1
doing the checking for block 2176827392
building backref for bytenr 2176827392 level 3
eb in path 2320363520, level 4, cowonly 0, owner 6124, gen 253957, last snap 243441, reloc 0, root 6124 isn't shared, need_check 1
block 2176913408 wasn't checked
done building backref tree
------------[ cut here ]------------ kernel BUG at fs/btrfs/relocation.c:411! 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 rfcomm parport_pc bnep ppdev binfmt_misc ecb btusb bluetooth intel_rapl 6lowpan_iphc x86_pkg_temp_thermal intel_powerclamp coretemp kvm rpcsec_gss_krb5 nfsd nfs_acl auth_rpcgss nfs snd_hda_codec_hdmi crct10dif_pclmul crc32_pclmul crc32c_intel fscache lockd sunrpc ghash_clmulni_intel snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_controller aesni_intel snd_hda_codec ablk_helper snd_usb_audio snd_pcm_oss snd_mixer_oss snd_pcm cryptd lrw snd_hwdep snd_usbmidi_lib snd_seq_midi snd_seq_midi_event snd_rawmidi uvcvideo gf128mul sb_edac videobuf2_core snd_seq psmouse videodev media videobuf2_vmalloc videobuf2_memops snd_timer snd_seq_device edac_core ehci_pci glue_helper tpm_infineon hp_wmi sparse_keymap snd soundcore serio_raw rfkill aes_x86_64 ehci_hcd microcode lpc_ich tpm_tis tpm evdev wmi processor lp parport loop hid_generic usbhid hid uas usb_storage dm_mod firewire_ohci xhci_hcd firewire_core crc_itu_t usbcore e1000e isci usb_common ptp libsas pps_core scsi_transport_sas CPU: 5 PID: 17084 Comm: btrfs-balance Not tainted 3.15.1-amd64-i915-preempt-20140216jbp3 #3 Hardware name: Hewlett-Packard HP Z620 Workstation/158A, BIOS J61 v01.17 11/05/2012 task: ffff880fcc858190 ti: ffff880fcd030000 task.ti: ffff880fcd030000 RIP: 0010:[<ffffffff81268bfb>] [<ffffffff81268bfb>] drop_backref_node+0x19/0x5d RSP: 0018:ffff880fcd033bf8 EFLAGS: 00010287 RAX: ffff8807dc9ce180 RBX: ffff8807dc9ce140 RCX: ffff880807eaf8e8 RDX: 0000000000000043 RSI: ffff8807dc9ce140 RDI: ffff880807eaf820 RBP: ffff880fcd033c08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 00000000ffe77402 R12: ffff880806f7c140 R13: ffff880807eaf820 R14: ffff8807e19fb040 R15: ffff880807eaf924 FS: 0000000000000000(0000) GS:ffff88082fca0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fab45ef3000 CR3: 0000000001c13000 CR4: 00000000000407e0 Stack: ffff880806f7c140 ffff880806f7c140 ffff880fcd033c40 ffffffff81268ca4 ffff8807cb274d10 ffff880807eaf908 ffff880807eaf8e8 00000000ffffffea ffff880807eaf800 ffff880fcd033cb8 ffffffff8126af02 ffff880807eaf820 Call Trace: [<ffffffff81268ca4>] remove_backref_node+0x65/0xc1 [<ffffffff8126af02>] relocate_block_group+0x390/0x49a [<ffffffff8126b167>] btrfs_relocate_block_group+0x15b/0x26d [<ffffffff81249b80>] btrfs_relocate_chunk.isra.23+0x5c/0x5e8 [<ffffffff8161fbfb>] ? _raw_spin_unlock+0x17/0x2a [<ffffffff812458cc>] ? free_extent_buffer+0x8a/0x8d [<ffffffff8124c406>] btrfs_balance+0x9b6/0xb74 [<ffffffff816167ad>] ? printk+0x54/0x56 [<ffffffff8124c5c4>] ? btrfs_balance+0xb74/0xb74 [<ffffffff8124c61d>] balance_kthread+0x59/0x7b [<ffffffff8106b4b4>] kthread+0xae/0xb6 [<ffffffff8106b406>] ? __kthread_parkme+0x61/0x61 [<ffffffff8162677c>] ret_from_fork+0x7c/0xb0 [<ffffffff8106b406>] ? __kthread_parkme+0x61/0x61 Code: 7b 68 e8 6b cc fd ff 48 c7 43 68 00 00 00 00 5b 5d c3 66 66 66 66 90 55 48 8d 46 40 48 89 e5 41 54 53 48 39 46 40 48 89 f3 74 02 <0f> 0b 49 89 fc 48 89 f7 e8 a1 ff ff ff 48 8d 7b 30 e8 3b ca ff RIP [<ffffffff81268bfb>] drop_backref_node+0x19/0x5d RSP <ffff880fcd033bf8> ---[ end trace 539f3f31bdb6112f ]--- Kernel panic - not syncing: Fatal exception Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffff9fffffff) ---[ end Kernel panic - not syncing: Fatal exception
Signature · 4 lines
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
.... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/ Quoted 7 lines · Marc MERLIN
fs/btrfs/relocation.c
Quoted 5 lines · Josef Bacik
Ok same drill as before, reset and apply this, hopefully no panic this time
fs/btrfs/relocation.c +0
-0
Ok I see what it is but I want to get rid of the panicing so we're going to do this dance a few more times until it's just failing to mount instead of panicing, and then we'll fix the actual bug. Give this a whirl, and I've added another printk just to make sure what I think is happening is actually what's happening, so same drill as before. Thanks,
Josef
fs/btrfs/relocation.c +33 -4
@@ -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,8 @@ struct backref_node *build_backref_tree(struct reloc_control *rc, node->lowest =1 ; cur = node; again: +printk (KERN_ERR "building backref for bytenr %llu level %d\n" , + cur->bytenr, cur->level); end =0 ; ptr =0 ; key.objectid = cur->bytenr;
@@ -757,6 +760,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 ; }
@@ -807,6 +811,8 @@ again: exist->owner == key.offset) || (key.type == BTRFS_SHARED_BLOCK_REF_KEY && exist->bytenr == key.offset))) { +printk (KERN_ERR "exist is fucking us, bytenr %llu, " +"type %d\n" , exist->bytenr, key.type); exist =NULL ; goto next; }
@@ -865,6 +871,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);
@@ -958,14 +965,30 @@ again: &root->state)) upper->cowonly =1 ; +printk (KERN_ERR "eb in path %llu, level %d, " +"cowonly %d, owner %llu, gen %llu, last " +"snap %llu, reloc %d, root %llu\n" , + upper->bytenr, upper->level, + upper->cowonly, upper->owner, +btrfs_header_generation (eb), +btrfs_root_last_snapshot (&root->root_item), +btrfs_header_flag (eb, +BTRFS_HEADER_FLAG_RELOC ), + root->objectid); +/* * 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 "is shared, need_check" +" %d\n" , need_check); upper->checked =0 ; -else + }else { +printk (KERN_ERR "isn't shared, " +"need_check %d\n" , need_check); upper->checked =1 ; + }/* * add the block to pending list if we
@@ -1019,6 +1042,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 +1086,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 +1143,7 @@ next: } } out: +printk (KERN_ERR "done building backref tree\n" );btrfs_free_path (path1);btrfs_free_path (path2);if (err) {
@@ -1123,7 +1153,6 @@ out:list_del_init (&lower->upper); } upper = node; -INIT_LIST_HEAD (&list);while (upper) {if (RB_EMPTY_NODE (&upper->rb_node)) {list_splice_tail (&upper->upper, &list);
Quoted 10 lines · Josef Bacik
Quoted 8 lines · Marc MERLIN
fs/btrfs/relocation.c
Quoted 6 lines · Josef Bacik
Ok same drill as before, reset and apply this, hopefully no panic this time
fs/btrfs/relocation.c +0
-0
Quoted 5 lines
Ok I see what it is but I want to get rid of the panicing so we're going to do this dance a few more times until it's just failing to mount instead of panicing, and then we'll fix the actual bug. Give this a whirl, and I've added another printk just to make sure what I think is happening is actually what's happening, so same drill as before. Thanks,
Patch applied. The panic moved :)
[ 313.756971] BTRFS: device label btrfs_pool2 devid 1 transid 254006 /dev/sda1 [ 313.757467] BTRFS info (device sda1): disk space caching is enabled [ 313.835538] BTRFS: detected SSD devices, enabling SSD mode [ 313.932327] BTRFS info (device sda1): continuing balance [ 313.990048] BTRFS info (device sda1): relocating block group 82699091968 flags 1 [ 316.085055] BTRFS info (device sda1): found 3719 extents [ 317.797058] running build_backref_tree [ 317.797075] building backref for bytenr 73005293568 level 0 [ 317.797090] eb in path 173444124672, level 1, cowonly 0, owner 256, gen 231481, last snap 243545, reloc 0, root 256 [ 317.797097] is shared, need_check 1 [ 317.797104] eb in path 67327229952, level 2, cowonly 0, owner 256, gen 243615, last snap 243545, reloc 0, root 256 [ 317.797109] isn't shared, need_check 0 [ 317.797117] eb in path 2176913408, level 3, cowonly 0, owner 256, gen 253956, last snap 243545, reloc 1, root 256 [ 317.797122] is shared, need_check 0 [ 317.797129] eb in path 2320281600, level 4, cowonly 0, owner 256, gen 253957, last snap 243545, reloc 0, root 256 [ 317.797134] isn't shared, need_check 0 [ 317.797139] doing the checking for block 173444124672 [ 317.797144] building backref for bytenr 173444124672 level 1 [ 317.797562] exist is 67327229952, checked 1 [ 317.797571] exist is fucking us, bytenr 67327229952, type 176 [ 317.797578] found shared ref 173244198912, needs checking [ 317.797583] doing the checking for block 173244198912 [ 317.797588] building backref for bytenr 173244198912 level 2 [ 317.798242] found shared ref 2177122304, needs checking [ 317.798251] found shared ref 2177081344, needs checking [ 317.798257] found shared ref 2176827392, needs checking [ 317.798263] doing the checking for block 2177122304 [ 317.798268] building backref for bytenr 2177122304 level 3 [ 317.798779] eb in path 2314657792, level 4, cowonly 0, owner 6125, gen 253957, last snap 243545, reloc 0, root 6125 [ 317.798787] isn't shared, need_check 1 [ 317.798798] doing the checking for block 2177081344 [ 317.798804] building backref for bytenr 2177081344 level 3 [ 317.798962] eb in path 2320146432, level 4, cowonly 0, owner 6123, gen 253957, last snap 243338, reloc 0, root 6123 [ 317.798970] isn't shared, need_check 1 [ 317.798976] doing the checking for block 2176827392 [ 317.798981] building backref for bytenr 2176827392 level 3 [ 317.799144] eb in path 2320363520, level 4, cowonly 0, owner 6124, gen 253957, last snap 243441, reloc 0, root 6124 [ 317.799151] isn't shared, need_check 1 [ 317.799158] block 2176913408 wasn't checked [ 317.799162] done building backref tree [ 317.799193] general protection fault: 0000 [#1] PREEMPT SMP [ 317.799207] Modules linked in: xt_NFLOG xt_tcpudp xt_comment xt_multiport ip6table_filter ip6_tables iptable_filter ip_tables x_tables nfnetlink_log nfnetlink fuse autofs4 rfcomm bnep bluetooth 6lowpan_iphc rfkill binfmt_misc snd_hda_codec_hdmi snd_hda_codec_analog snd_hda_codec_generic intel_powerclamp coretemp kvm_intel kvm snd_hda_intel snd_hda_controller snd_hda_codec crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel ehci_pci snd_hwdep rpcsec_gss_krb5 snd_pcm_oss snd_mixer_oss snd_pcm nfsd auth_rpcgss snd_seq_midi snd_seq_midi_event nfs_acl snd_rawmidi nfs lockd sunrpc snd_seq snd_seq_device ppdev aes_x86_64 ehci_hcd snd_timer lrw parport_pc dcdbas i7core_edac lp gf128mul gpio_ich dell_wmi parport snd edac_core acpi_cpufreq soundcore lpc_ich processor loop glue_helper tpm_tis tpm sparse_keymap wmi psmouse serio_raw joydev ablk_helper cryptd evdev fscache microcode hid_generic usbhid hid sr_mod cdrom dm_mod tg3 libphy ptp pps_core uhci_hcd usbcore usb_common [ 317.799543] CPU: 1 PID: 4903 Comm: btrfs-balance Not tainted 3.15.1-amd64-i915-preempt-20140216jbp4 #1 [ 317.799548] Hardware name: Dell Inc. Precision WorkStation T3500 /09KPNV, BIOS A10 01/21/2011 [ 317.799555] task: ffff8805abd56450 ti: ffff8805abd58000 task.ti: ffff8805abd58000 [ 317.799560] RIP: 0010:[<ffffffff81265654>] [<ffffffff81265654>] list_del+0x8/0x2f [ 317.799573] RSP: 0018:ffff8805abd5bc00 EFLAGS: 00010287 [ 317.799579] RAX: dead000000200200 RBX: ffff8805abfb1640 RCX: ffff8805f57b88e8 [ 317.799584] RDX: dead000000100100 RSI: ffff8805f6d83940 RDI: ffff8805abff8750 [ 317.799589] RBP: ffff8805abd5bc40 R08: 0000000000000000 R09: 0000000000000000 [ 317.799594] R10: 00000000ffffffff R11: 0000000000000000 R12: ffff8805f6d83940 [ 317.799599] R13: ffff8805f57b8820 R14: ffff8805abff8740 R15: ffff8805f6d83980 [ 317.799605] FS: 0000000000000000(0000) GS:ffff880617220000(0000) knlGS:0000000000000000 [ 317.799610] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 317.799615] CR2: 00007f644026f000 CR3: 0000000001c13000 CR4: 00000000000007e0 [ 317.799621] Stack: [ 317.799625] ffff8805abd5bc40 ffffffff81268c9d ffff8805f57b8924 ffff8805ba7f86e0 [ 317.799643] ffff8805f57b8908 ffff8805f57b88e8 00000000ffffffea ffff8805f57b8800 [ 317.799659] ffff8805abd5bcb8 ffffffff8126af28 ffff8805f57b8820 00000001138d93a8 [ 317.799674] Call Trace: [ 317.799683] [<ffffffff81268c9d>] ? remove_backref_node+0x4c/0xd5 [ 317.799690] [<ffffffff8126af28>] relocate_block_group+0x390/0x49a [ 317.799698] [<ffffffff8126b18d>] btrfs_relocate_block_group+0x15b/0x26d [ 317.799706] [<ffffffff81249b80>] btrfs_relocate_chunk.isra.23+0x5c/0x5e8 [ 317.799715] [<ffffffff8161fc1b>] ? _raw_spin_unlock+0x17/0x2a [ 317.799722] [<ffffffff812458cc>] ? free_extent_buffer+0x8a/0x8d [ 317.799729] [<ffffffff8124c406>] btrfs_balance+0x9b6/0xb74 [ 317.799737] [<ffffffff816167cd>] ? printk+0x54/0x56 [ 317.799745] [<ffffffff8124c5c4>] ? btrfs_balance+0xb74/0xb74 [ 317.799752] [<ffffffff8124c61d>] balance_kthread+0x59/0x7b [ 317.799759] [<ffffffff8106b4b4>] kthread+0xae/0xb6 [ 317.799765] [<ffffffff8106b406>] ? __kthread_parkme+0x61/0x61 [ 317.799774] [<ffffffff8162677c>] ret_from_fork+0x7c/0xb0 [ 317.799780] [<ffffffff8106b406>] ? __kthread_parkme+0x61/0x61 [ 317.799785] Code: 00 00 00 48 c7 c7 fd 89 aa 81 e8 ad 41 eb ff 48 85 c0 48 89 05 6e 6b cb 00 0f 84 7b ff ff ff 31 c0 5d c3 48 8b 47 08 48 8b 17 55 <48> 89 42 08 48 89 10 48 b8 00 01 10 00 00 00 ad de 48 89 07 48 [ 317.799984] RIP [<ffffffff81265654>] list_del+0x8/0x2f [ 317.799994] RSP <ffff8805abd5bc00> [ 317.800032] ---[ end trace a9b76875452f420d ]--- [ 317.800039] Kernel panic - not syncing: Fatal exception [ 317.800181] Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffff9fffffff) [ 317.800187] ---[ end Kernel panic - not syncing: Fatal exception
Signature · 4 lines
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
.... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/ Quoted 11 lines · Marc MERLIN
Quoted 10 lines · Josef Bacik
Quoted 8 lines · Marc MERLIN
Quoted 6 lines · Josef Bacik
Ok same drill as before, reset and apply this, hopefully no panic this time
fs/btrfs/relocation.c +0
-0
Quoted 8 lines
Quoted 5 lines
Ok I see what it is but I want to get rid of the panicing so we're going to do this dance a few more times until it's just failing to mount instead of panicing, and then we'll fix the actual bug. Give this a whirl, and I've added another printk just to make sure what I think is happening is actually what's happening, so same drill as before. Thanks,
Patch applied. The panic moved :)
Is it possible for me to get a btrfs-image of this fs? That would make this a lot faster. Thanks,
Josef