Skip to contentSkip to conversation

Assertion in tree-log.c

DISCUSSION Ellis H. Wilson III 3 participants 3 messages Dec 7, 2020 – Dec 9, 2020 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hi all,

We've hit this assertion a few times, and I wanted to know if it was a known issue:

Dec 05 08:53:51 6afa1e4331fa46 kernel: assertion failed: ret == 0, file: fs/btrfs/tree-log.c, line: 4286
Dec 05 08:53:51 6afa1e4331fa46 kernel: ------------[ cut here ]------------
Dec 05 08:53:51 6afa1e4331fa46 kernel: kernel BUG at fs/btrfs/ctree.h:3295!
Dec 05 08:53:51 6afa1e4331fa46 kernel: invalid opcode: 0000 [#1] SMP PTI
Dec 05 08:53:51 6afa1e4331fa46 kernel: Modules linked in: af_packet_diag netlink_diag sctp_diag sctp libcrc32c tcp_diag udp_diag raw_diag inet_diag unix_diag af_packet binfmt_misc bonding iscsi_ibft iscsi_boot_sysfs msr nls_iso8859_1 nls_cp437 vfat fat dax_pmem btrfs(O)
ipmi_ssif xor iTCO_wdt nd_pmem device_dax nd_btt raid6_pq iTCO_vendor_support intel_rapl ib_core skx_edac x86_pkg_temp_thermal intel_powerclamp coretemp raid0 kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel pcbc aesni_intel aes_x86_64 crypto_simd glue_helper cryptd ioatdma md_mod ipmi_si nfit i2c_i801 lpc_ich mei_me shpchp ipmi_devintf mei dca pcspkr wmi joydev ipmi_msghandler libnvdimm acpi_pad button hid_generic usbhid ast i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt xhci_pci i40e(O) fb_sys_fops xhci_hcd
Dec 05 08:53:52 6afa1e4331fa46 kernel:  ttm ptp pps_core nvme drm ahci drm_panel_orientation_quirks nvme_core usbcore libahci sg dm_multipath dm_mod scsi_dh_rdac scsi_dh_emc scsi_dh_alua efivarfs
Dec 05 08:53:52 6afa1e4331fa46 kernel: CPU: 2 PID: 6897 Comm: iopathv4 Tainted: G           O     4.12.14-lp150.11-default #1 openSUSE Leap 15.0 (unreleased)
Dec 05 08:53:52 6afa1e4331fa46 kernel: task: ffff8808351146c0 task.stack: ffffc90008704000
Dec 05 08:53:52 6afa1e4331fa46 kernel: RIP: 0010:assfail.constprop.28+0x18/0x1a [btrfs]
Dec 05 08:53:52 6afa1e4331fa46 kernel: RSP: 0018:ffffc90008707b08 EFLAGS: 00010296
Dec 05 08:53:52 6afa1e4331fa46 kernel: RAX: 0000000000000041 RBX: ffff880117eb0990 RCX: 0000000000000000
Dec 05 08:53:52 6afa1e4331fa46 kernel: RDX: ffff88085c09fd40 RSI: ffff88085c097a68 RDI: ffff88085c097a68
Dec 05 08:53:52 6afa1e4331fa46 kernel: RBP: 0000000000000ef2 R08: 0000000000002dde R09: 0000000000000003
Dec 05 08:53:52 6afa1e4331fa46 kernel: R10: 0000000000000189 R11: 0000000000000001 R12: 0000160000000000
Dec 05 08:53:52 6afa1e4331fa46 kernel: R13: 0000000000000096 R14: ffff880000000000 R15: ffff880141d39690
Dec 05 08:53:52 6afa1e4331fa46 kernel: FS:  00007f7ca3d96700(0000) GS:ffff88085c080000(0000) knlGS:0000000000000000
Dec 05 08:53:52 6afa1e4331fa46 kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Dec 05 08:53:52 6afa1e4331fa46 kernel: CR2: 00007f296c031c20 CR3: 000000083120a003 CR4: 00000000007606e0
Dec 05 08:53:52 6afa1e4331fa46 kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
Dec 05 08:53:52 6afa1e4331fa46 kernel: DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Dec 05 08:53:52 6afa1e4331fa46 kernel: PKRU: 55555554
Dec 05 08:53:52 6afa1e4331fa46 kernel: Call Trace:
Dec 05 08:53:52 6afa1e4331fa46 kernel:  copy_items+0x9b4/0xbe0 [btrfs]
Dec 05 08:53:52 6afa1e4331fa46 kernel:  btrfs_log_inode+0x775/0xe00 [btrfs]
Dec 05 08:53:52 6afa1e4331fa46 kernel: btrfs_log_inode_parent+0x249/0xd30 [btrfs]
Dec 05 08:53:52 6afa1e4331fa46 kernel:  ? kmem_cache_alloc+0x1a8/0x510
Dec 05 08:53:52 6afa1e4331fa46 kernel:  ? __filemap_fdatawrite_range+0xa3/0xe0
Dec 05 08:53:52 6afa1e4331fa46 kernel:  ? __filemap_fdatawrite_range+0xb1/0xe0
Dec 05 08:53:52 6afa1e4331fa46 kernel:  ? wait_current_trans+0x1f/0xd0 [btrfs]
Dec 05 08:53:52 6afa1e4331fa46 kernel:  ? join_transaction+0x22/0x3f0 [btrfs]
Dec 05 08:53:52 6afa1e4331fa46 kernel:  btrfs_log_dentry_safe+0x58/0x80 [btrfs]
Dec 05 08:53:52 6afa1e4331fa46 kernel:  btrfs_sync_file+0x2dc/0x420 [btrfs]
Dec 05 08:53:52 6afa1e4331fa46 kernel:  do_fsync+0x38/0x60
Dec 05 08:53:52 6afa1e4331fa46 kernel:  SyS_fsync+0xc/0x10
Dec 05 08:53:52 6afa1e4331fa46 kernel:  do_syscall_64+0x7b/0x140
Dec 05 08:53:52 6afa1e4331fa46 kernel: entry_SYSCALL_64_after_hwframe+0x3d/0xa2
Dec 05 08:53:52 6afa1e4331fa46 kernel: RIP: 0033:0x7f7caaf8f5fc
Dec 05 08:53:52 6afa1e4331fa46 kernel: RSP: 002b:00007f7ca3d93990 EFLAGS: 00000293 ORIG_RAX: 000000000000004a
Dec 05 08:53:52 6afa1e4331fa46 kernel: RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f7caaf8f5fc
Dec 05 08:53:52 6afa1e4331fa46 kernel: RDX: 0000000000000000 RSI: 0000000000080002 RDI: 0000000000000111
Dec 05 08:53:52 6afa1e4331fa46 kernel: RBP: 0000000000000000 R08: 0000000000001777 R09: 00000000eddb1d58
Dec 05 08:53:52 6afa1e4331fa46 kernel: R10: fffffffffffffa88 R11: 0000000000000293 R12: 00007f7ca3d93a50
Dec 05 08:53:52 6afa1e4331fa46 kernel: R13: 0000000001bea4e0 R14: 00000000eddb1d58 R15: f5402026a5ae13a5
Dec 05 08:53:52 6afa1e4331fa46 kernel: Code: 80 a0 48 89 fe 48 c7 c7 30 27 81 a0 e8 61 70 9a e0 0f 0b 89 f1 48 c7 c2 3e bf 80 a0 48 89 fe 48 c7 c7 00 29 81 a0 e8 47 70 9a e0 <0f> 0b 0f 1f 44 00 00 41 57 41 56 41 be f4 ff ff ff 41 55 41 54
Dec 05 08:53:52 6afa1e4331fa46 kernel: RIP: assfail.constprop.28+0x18/0x1a [btrfs] RSP: ffffc90008707b08
Dec 05 08:53:52 6afa1e4331fa46 kernel: ---[ end trace 13cc0fa206f6ac86 ]---

The closest thing I can find to it is this patch, which appears to be archived and open:

https://lore.kernel.org/linux-btrfs/[email protected]/T/

Sorry if my search-engine-skills are failing me and there is a better matching bug that's been fixed already for this.

Best,

ellis

#1 lore raw
Quoted 9 lines · Ellis H. Wilson III

Hi all,

We've hit this assertion a few times, and I wanted to know if it was a known issue:

Dec 05 08:53:52 6afa1e4331fa46 kernel: CPU: 2 PID: 6897 Comm: iopathv4
Tainted: G           O     4.12.14-lp150.11-default #1 openSUSE Leap

15.0 (unreleased)

This is quite an old kernel and no longer maintained by the stable team, so it's entirely up to the distro to maintain it. My guess is that 15.0 isn't maintained at all, and you should be on 15.1 or 15.2 kernels.
https://en.opensuse.org/Lifetime

Signature · 1 line
Chris Murphy
#2 lore raw
In reply to Ellis H. Wilson III
Quoted 24 lines · Ellis H. Wilson III

Hi all,

We've hit this assertion a few times, and I wanted to know if it was a known issue:

Dec 05 08:53:51 6afa1e4331fa46 kernel: assertion failed: ret == 0, file:
fs/btrfs/tree-log.c, line: 4286
Dec 05 08:53:51 6afa1e4331fa46 kernel: ------------[ cut here ]------------
Dec 05 08:53:51 6afa1e4331fa46 kernel: kernel BUG at fs/btrfs/ctree.h:3295!
Dec 05 08:53:51 6afa1e4331fa46 kernel: invalid opcode: 0000 [#1] SMP PTI
Dec 05 08:53:51 6afa1e4331fa46 kernel: Modules linked in: af_packet_diag

netlink_diag sctp_diag sctp libcrc32c tcp_diag udp_diag raw_diag inet_diag unix_diag af_packet binfmt_misc bonding iscsi_ibft iscsi_boot_sysfs msr nls_iso8859_1 nls_cp437 vfat fat dax_pmem btrfs(O) ipmi_ssif xor iTCO_wdt nd_pmem device_dax nd_btt raid6_pq iTCO_vendor_support intel_rapl ib_core skx_edac x86_pkg_temp_thermal intel_powerclamp coretemp raid0 kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel pcbc aesni_intel aes_x86_64 crypto_simd glue_helper cryptd ioatdma md_mod ipmi_si nfit i2c_i801 lpc_ich mei_me shpchp ipmi_devintf mei dca pcspkr wmi joydev ipmi_msghandler libnvdimm acpi_pad button hid_generic usbhid ast i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt xhci_pci i40e(O) fb_sys_fops xhci_hcd

Quoted 6 lines
Dec 05 08:53:52 6afa1e4331fa46 kernel:  ttm ptp pps_core nvme drm ahci
drm_panel_orientation_quirks nvme_core usbcore libahci sg dm_multipath
dm_mod scsi_dh_rdac scsi_dh_emc scsi_dh_alua efivarfs
Dec 05 08:53:52 6afa1e4331fa46 kernel: CPU: 2 PID: 6897 Comm: iopathv4
Tainted: G           O     4.12.14-lp150.11-default #1 openSUSE Leap

15.0 (unreleased)

As mentioned before by Chris, that's an old openSUSE Leap release. You should move to Leap 15.2 (or 15.1, but its support ends by the end of January).

Quoted 71 lines
Dec 05 08:53:52 6afa1e4331fa46 kernel: task: ffff8808351146c0
task.stack: ffffc90008704000
Dec 05 08:53:52 6afa1e4331fa46 kernel: RIP:
0010:assfail.constprop.28+0x18/0x1a [btrfs]
Dec 05 08:53:52 6afa1e4331fa46 kernel: RSP: 0018:ffffc90008707b08
EFLAGS: 00010296
Dec 05 08:53:52 6afa1e4331fa46 kernel: RAX: 0000000000000041 RBX:
ffff880117eb0990 RCX: 0000000000000000
Dec 05 08:53:52 6afa1e4331fa46 kernel: RDX: ffff88085c09fd40 RSI:
ffff88085c097a68 RDI: ffff88085c097a68
Dec 05 08:53:52 6afa1e4331fa46 kernel: RBP: 0000000000000ef2 R08:
0000000000002dde R09: 0000000000000003
Dec 05 08:53:52 6afa1e4331fa46 kernel: R10: 0000000000000189 R11:
0000000000000001 R12: 0000160000000000
Dec 05 08:53:52 6afa1e4331fa46 kernel: R13: 0000000000000096 R14:
ffff880000000000 R15: ffff880141d39690
Dec 05 08:53:52 6afa1e4331fa46 kernel: FS:  00007f7ca3d96700(0000)
GS:ffff88085c080000(0000) knlGS:0000000000000000
Dec 05 08:53:52 6afa1e4331fa46 kernel: CS:  0010 DS: 0000 ES: 0000 CR0:
0000000080050033
Dec 05 08:53:52 6afa1e4331fa46 kernel: CR2: 00007f296c031c20 CR3:
000000083120a003 CR4: 00000000007606e0
Dec 05 08:53:52 6afa1e4331fa46 kernel: DR0: 0000000000000000 DR1:
0000000000000000 DR2: 0000000000000000
Dec 05 08:53:52 6afa1e4331fa46 kernel: DR3: 0000000000000000 DR6:
00000000fffe0ff0 DR7: 0000000000000400
Dec 05 08:53:52 6afa1e4331fa46 kernel: PKRU: 55555554
Dec 05 08:53:52 6afa1e4331fa46 kernel: Call Trace:
Dec 05 08:53:52 6afa1e4331fa46 kernel:  copy_items+0x9b4/0xbe0 [btrfs]
Dec 05 08:53:52 6afa1e4331fa46 kernel:  btrfs_log_inode+0x775/0xe00 [btrfs]
Dec 05 08:53:52 6afa1e4331fa46 kernel:
btrfs_log_inode_parent+0x249/0xd30 [btrfs]
Dec 05 08:53:52 6afa1e4331fa46 kernel:  ? kmem_cache_alloc+0x1a8/0x510
Dec 05 08:53:52 6afa1e4331fa46 kernel:  ?
__filemap_fdatawrite_range+0xa3/0xe0
Dec 05 08:53:52 6afa1e4331fa46 kernel:  ?
__filemap_fdatawrite_range+0xb1/0xe0
Dec 05 08:53:52 6afa1e4331fa46 kernel:  ? wait_current_trans+0x1f/0xd0
[btrfs]
Dec 05 08:53:52 6afa1e4331fa46 kernel:  ? join_transaction+0x22/0x3f0
[btrfs]
Dec 05 08:53:52 6afa1e4331fa46 kernel:  btrfs_log_dentry_safe+0x58/0x80
[btrfs]
Dec 05 08:53:52 6afa1e4331fa46 kernel:  btrfs_sync_file+0x2dc/0x420 [btrfs]
Dec 05 08:53:52 6afa1e4331fa46 kernel:  do_fsync+0x38/0x60
Dec 05 08:53:52 6afa1e4331fa46 kernel:  SyS_fsync+0xc/0x10
Dec 05 08:53:52 6afa1e4331fa46 kernel:  do_syscall_64+0x7b/0x140
Dec 05 08:53:52 6afa1e4331fa46 kernel:
entry_SYSCALL_64_after_hwframe+0x3d/0xa2
Dec 05 08:53:52 6afa1e4331fa46 kernel: RIP: 0033:0x7f7caaf8f5fc
Dec 05 08:53:52 6afa1e4331fa46 kernel: RSP: 002b:00007f7ca3d93990
EFLAGS: 00000293 ORIG_RAX: 000000000000004a
Dec 05 08:53:52 6afa1e4331fa46 kernel: RAX: ffffffffffffffda RBX:
0000000000000000 RCX: 00007f7caaf8f5fc
Dec 05 08:53:52 6afa1e4331fa46 kernel: RDX: 0000000000000000 RSI:
0000000000080002 RDI: 0000000000000111
Dec 05 08:53:52 6afa1e4331fa46 kernel: RBP: 0000000000000000 R08:
0000000000001777 R09: 00000000eddb1d58
Dec 05 08:53:52 6afa1e4331fa46 kernel: R10: fffffffffffffa88 R11:
0000000000000293 R12: 00007f7ca3d93a50
Dec 05 08:53:52 6afa1e4331fa46 kernel: R13: 0000000001bea4e0 R14:
00000000eddb1d58 R15: f5402026a5ae13a5
Dec 05 08:53:52 6afa1e4331fa46 kernel: Code: 80 a0 48 89 fe 48 c7 c7 30
27 81 a0 e8 61 70 9a e0 0f 0b 89 f1 48 c7 c2 3e bf 80 a0 48 89 fe 48 c7
c7 00 29 81 a0 e8 47 70 9a e0 <0f> 0b 0f 1f 44 00 00 41 57 41 56 41 be
f4 ff ff ff 41 55 41 54
Dec 05 08:53:52 6afa1e4331fa46 kernel: RIP:
assfail.constprop.28+0x18/0x1a [btrfs] RSP: ffffc90008707b08
Dec 05 08:53:52 6afa1e4331fa46 kernel: ---[ end trace 13cc0fa206f6ac86 ]---
Quoted 7 lines

The closest thing I can find to it is this patch, which appears to be archived and open:

https://lore.kernel.org/linux-btrfs/[email protected]/T/

Sorry if my search-engine-skills are failing me and there is a better matching bug that's been fixed already for this.

No, that's a fix for a very different and unrelated problem.

What fixes the problem are the two following patches:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0c713cbab6200b0ab6473b50435e450a6e1de85d

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5e548b32018d96c377fda4bdac2bf511a448ca67

The second one does not mention any functional problem in its changelog, but that's because I only realized it caused a functional problem, a similar race like the first one, after it was merged into Linus' tree.
Both are in openSUSE Leap 15.2 (and 15.1).

Quoted 4 lines

Best,

ellis

Signature · 3 lines
Filipe David Manana,

“Whether you think you can, or you think you can't — you're right.”