Skip to contentSkip to conversation

Increased reports since 6.15.3 of corruption within the log tree

DISCUSSION Peter Jung 7 participants 11 messages Jul 7, 2025 – Jul 25, 2025 Btrfs file system

lore
Share & tools
lore

Peter Jung

author
#0 lore raw

Hi all,

There has been increased reports of users reporting that they could not boot into their system anymore - sometimes after a needed force shutdown, but also according the users after a normal shutdown/reboot process.

The filesystem can be accessible again, after running following command in the chroot:

```
sudo btrfs rescue zero-log /dev/sdX
```

There is no way to reproduce this constantly.

Following commits did land in 6.15.3:

btrfs: exit after state insertion failure at btrfs_convert_extent_bit()
btrfs: exit after state split error at set_extent_bit()
btrfs: fix fsync of files with no hard links not persisting deletion
btrfs: fix invalid data space release when truncating block in NOCOW mode
btrfs: fix wrong start offset for delalloc space release during mmap write
btrfs: scrub: fix a wrong error type when metadata bytenr mismatches
btrfs: scrub: update device stats when an error is detected

Some reports:
https://discussion.fedoraproject.org/t/fedora-kde-no-longer-booting-likely-filesystem-btrfs-corruption/157232/10
https://www.reddit.com/r/cachyos/comments/1lmzmm4/failed_to_mount_on_real_rooted/
https://www.reddit.com/r/cachyos/comments/1llin1n/error_failed_to_mount_uuid_on_real_root_cant_boot/
https://www.reddit.com/r/cachyos/comments/1llrpcb/unable_to_boot_os_you_are_in_emergency_mode/
https://www.reddit.com/r/cachyos/comments/1lr5nro/my_cachyos_is_down/

We do not know, if the issues have decreased or improved since 6.15.4/6.15.5 since we can not ensure, that users have their system fully updated. All in all we got on CachyOS around 50-80 reports since the push of 6.15.3, but there are also increased reports in Fedora and archlinux

Best regards,

Peter "ptr1337" Jung

#1 lore raw
Quoted 22 lines · Peter Jung

Hi all,

There has been increased reports of users reporting that they could not boot into their system anymore - sometimes after a needed force shutdown, but also according the users after a normal shutdown/reboot process.

The filesystem can be accessible again, after running following command in the chroot:

```
sudo btrfs rescue zero-log /dev/sdX
```

There is no way to reproduce this constantly.

Following commits did land in 6.15.3:

btrfs: exit after state insertion failure at btrfs_convert_extent_bit()
btrfs: exit after state split error at set_extent_bit()
btrfs: fix fsync of files with no hard links not persisting deletion
btrfs: fix invalid data space release when truncating block in NOCOW mode
btrfs: fix wrong start offset for delalloc space release during mmap write
btrfs: scrub: fix a wrong error type when metadata bytenr mismatches
btrfs: scrub: update device stats when an error is detected

Quoted 6 lines

Some reports:
https://discussion.fedoraproject.org/t/fedora-kde-no-longer-booting- likely-filesystem-btrfs-corruption/157232/10
https://www.reddit.com/r/cachyos/comments/1lmzmm4/ failed_to_mount_on_real_rooted/
https://www.reddit.com/r/cachyos/comments/1llin1n/ error_failed_to_mount_uuid_on_real_root_cant_boot/
https://www.reddit.com/r/cachyos/comments/1llrpcb/ unable_to_boot_os_you_are_in_emergency_mode/
https://www.reddit.com/r/cachyos/comments/1lr5nro/my_cachyos_is_down/

Unfortunately none of those comment is helpful.

They do not provide the dmesg of the mount failure, and that's the most important info.

If you got any new reports, please ask for the dmesg of inside the emergency shell.

Thanks,
Qu

Quoted 8 lines

We do not know, if the issues have decreased or improved since 6.15.4/6.15.5 since we can not ensure, that users have their system fully updated. All in all we got on CachyOS around 50-80 reports since the push of 6.15.3, but there are also increased reports in Fedora and archlinux

Best regards,

Peter "ptr1337" Jung

author
#2 lore raw
Quoted 8 lines · Qu Wenruo

Unfortunately none of those comment is helpful.

They do not provide the dmesg of the mount failure, and that's the most important info.

If you got any new reports, please ask for the dmesg of inside the emergency shell.

Thanks,
Qu

Thanks for your answer - but how it would work saving the logs in the emergency shell, specially if the root partitions can not be mounted?

Best,

Peter

#3 lore raw
Quoted 9 lines · Peter Jung
Quoted 5 lines · Qu Wenruo

Unfortunately none of those comment is helpful.

They do not provide the dmesg of the mount failure, and that's the most important info.

Quoted 9 lines
Quoted 5 lines

If you got any new reports, please ask for the dmesg of inside the emergency shell.

Thanks,
Qu

Thanks for your answer - but how it would work saving the logs in the emergency shell, specially if the root partitions can not be mounted?

You can save it to any other filesystem that can be mounted including a USB FAT stick.

#4 lore raw
In reply to Peter Jung
Quoted 5 lines · Peter Jung
Quoted 2 lines · Qu Wenruo

Unfortunately none of those comment is helpful.

Quoted 8 lines
Quoted 6 lines

They do not provide the dmesg of the mount failure, and that's the most important info.

If you got any new reports, please ask for the dmesg of inside the emergency shell.

Thanks,
Qu

Thanks for your answer - but how it would work saving the logs in the emergency shell, specially if the root partitions can not be mounted?

Just run "dmesg | tail -n 20" and use a phone to take a photo, just like all the reporters are already doing.

Thanks,
Qu

Quoted 5 lines

Best,

Peter

#5 lore raw
In reply to Peter Jung
Quoted 2 lines · Peter Jung

Thanks for your answer - but how it would work saving the logs in the emergency shell, specially if the root partitions can not be mounted?

You can mount a USB stick or even the EFI system partition to /sysroot and then copy the logs there.

Also for Qu et al, we have a couple reports in Fedora of log tree replay issues with 6.15 series too. I've requested dmesg, but at least one of the users already followed advice to zero the log tree. Hopefully we get one to report dmesg soon.

Signature · 1 line
Chris Murphy
author
#6 lore raw

Hi all,

There has been now logs available on the redhat bugzilla, which is the same issue.

https://bugzilla.redhat.com/show_bug.cgi?id=2374607
https://bugzilla.redhat.com/attachment.cgi?id=2094982

Best,

Peter

Quoted 10 lines · Chris Murphy
Quoted 2 lines · Peter Jung

Thanks for your answer - but how it would work saving the logs in the emergency shell, specially if the root partitions can not be mounted?

You can mount a USB stick or even the EFI system partition to /sysroot and then copy the logs there.

Also for Qu et al, we have a couple reports in Fedora of log tree replay issues with 6.15 series too. I've requested dmesg, but at least one of the users already followed advice to zero the log tree. Hopefully we get one to report dmesg soon.

-- Chris Murphy

author
#7 lore raw
In reply to Chris Murphy

Hi all,

Here you can find the trace of dmesg, after the log tree is corrupted. This has been taken on an Live ISO, which should reflect the same dmesg as in the emergency shell, when trying to mount the disk.

```
[  205.774875] BTRFS: device fsid b09a027e-a61d-424f-858f-2e02be61b342 devid 1 transid 159947 /dev/nvme0n1p2 (259:2) scanned by mount (2499)
[  205.775120] BTRFS info (device nvme0n1p2): first mount of filesystem b09a027e-a61d-424f-858f-2e02be61b342
[  205.775142] BTRFS info (device nvme0n1p2): using crc32c (crc32c-intel) checksum algorithm
[  205.775150] BTRFS info (device nvme0n1p2): using free-space-tree
[  205.792525] BTRFS info (device nvme0n1p2): start tree-log replay
[  205.875103] BTRFS: error (device nvme0n1p2) in btrfs_replay_log:2104: errno=-5 IO failure (Failed to recover log tree)
[  205.876751] ------------[ cut here ]------------
[  205.876753] WARNING: CPU: 4 PID: 2499 at fs/btrfs/block-rsv.c:456 btrfs_release_global_block_rsv+0xa9/0xe0 [btrfs]
[  205.876813] Modules linked in: ccm snd_seq_dummy snd_hrtimer snd_seq snd_seq_device qrtr snd_soc_dmic snd_soc_acp6x_mach snd_acp6x_pdm_dma snd_sof_amd_acp70 snd_sof_amd_acp63 snd_sof_amd_vangogh snd_sof_amd_rembrandt snd_sof_amd_renoir snd_sof_amd_acp snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils snd_pci_ps snd_soc_acpi_amd_match soundwire_amd soundwire_generic_allocation snd_amd_sdw_acpi soundwire_bus snd_soc_sdca snd_soc_core ac97_bus snd_pcm_dmaengine snd_compress amd_atl intel_rapl_msr intel_rapl_common kvm_amd hid_sensor_custom snd_hda_codec_realtek snd_rpl_pci_acp6x snd_hda_scodec_component kvm uvcvideo snd_hda_codec_generic snd_acp_pci snd_hda_codec_hdmi snd_acp_legacy_common iwlmvm crct10dif_pclmul snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hda_core snd_pci_acp6x polyval_clmulni uvc snd_hwdep videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common videodev mc polyval_generic nvidia_drm(OE) hid_multitouch btusb spd5118 hid_sensor_hub snd_pcm mac80211
[  205.876885]  ghash_clmulni_intel snd_timer libarc4 btbcm nvidia_modeset(OE) snd_pci_acp5x btintel snd_rn_pci_acp3x sha1_ssse3 ptp snd snd_acp_config btrtl joydev pps_core mousedev wacom iwlwifi rapl i2c_piix4 soundcore ideapad_laptop snd_soc_acpi i2c_hid_acpi ucsi_acpi btmtk cfg80211 nvidia(OE) platform_profile typec_ucsi bluetooth typec sparse_keymap roles wmi_bmof nvidia_wmi_ec_backlight k10temp rfkill amd_pmc snd_pci_acp3x ccp i2c_hid mac_hid acpi_tad i2c_smbus zfs(OE) spl(OE) pkcs8_key_parser ntsync i2c_dev nfnetlink lz4 zram 842_decompress 842_compress lz4hc_compress lz4_compress ip_tables x_tables overlay squashfs loop isofs cdrom dm_mod hid_logitech_hidpp hid_logitech_dj amdgpu nouveau btrfs mxm_wmi drm_gpuvm drm_buddy raid6_pq drm_exec amdxcp crc32_pclmul xor gpu_sched uas drm_suballoc_helper sha512_ssse3 libcrc32c crc32c_generic crc32c_intel usb_storage hid_generic serio_raw sha256_ssse3 drm_ttm_helper sdhci_pci atkbd aesni_intel ttm cqhci libps2 gf128mul vivaldi_fmap sdhci_uhs2 crypto_simd i2c_algo_bit nvme
[  205.876991]  cryptd sdhci drm_display_helper usbhid nvme_core i8042 mmc_core video cec crc16 nvme_auth serio wmi
[  205.877008] CPU: 4 UID: 0 PID: 2499 Comm: mount Tainted: G OE      6.13.0-2-cachyos #1 b109e82a9bce3931c5e96e558e71463b86410157
[  205.877013] Tainted: [O]=OOT_MODULE, [E]=UNSIGNED_MODULE
[  205.877015] Hardware name: LENOVO 82SN/LNVNB161216, BIOS J4CN44WW 01/03/2025
[  205.877017] RIP: 0010:btrfs_release_global_block_rsv+0xa9/0xe0 [btrfs]
[  205.877059] Code: 01 00 00 00 74 b1 0f 0b 48 83 bb 40 01 00 00 00 74 af 0f 0b 48 83 bb 48 01 00 00 00 74 ad 0f 0b 48 83 bb 70 01 00 00 00 74 ab <0f> 0b 48 83 bb 78 01 00 00 00 74 a9 0f 0b 48 83 bb a8 01 00 00 00
[  205.877062] RSP: 0018:ffffb1dccf0b3930 EFLAGS: 00010286
[  205.877065] RAX: 000000000aa74000 RBX: ffff9d1309b3e000 RCX: 0000000000000000
[  205.877067] RDX: 0000000000000001 RSI: ffff9d11968a8000 RDI: ffff9d11968a8008
[  205.877069] RBP: ffff9d1309b3e000 R08: 0000000000200018 R09: 0000000000000000
[  205.877071] R10: ffffffff00000000 R11: ffff9d11a3b70d28 R12: 0000000000000000
[  205.877073] R13: ffff9d1309b3e090 R14: dead000000000122 R15: ffff9d1309b3e098
[  205.877075] FS:  00007f78c965bb80(0000) GS:ffff9d146fe00000(0000) knlGS:0000000000000000
[  205.877077] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  205.877079] CR2: 000077ed0d308068 CR3: 0000000105c44000 CR4: 0000000000f50ef0
[  205.877081] PKRU: 55555554
[  205.877083] Call Trace:
[  205.877085]  <TASK>
[  205.877087]  ? __warn+0xd5/0x1d0
[  205.877093]  ? btrfs_release_global_block_rsv+0xa9/0xe0 [btrfs d6619631500fe860881f162577f2f551d395ff24]
[  205.877131]  ? report_bug+0x144/0x1f0
[  205.877137]  ? handle_bug+0x6a/0x90
[  205.877141]  ? exc_invalid_op+0x1a/0x50
[  205.877144]  ? asm_exc_invalid_op+0x1a/0x20
[  205.877151]  ? btrfs_release_global_block_rsv+0xa9/0xe0 [btrfs d6619631500fe860881f162577f2f551d395ff24]
[  205.877187]  btrfs_free_block_groups+0x3a6/0x490 [btrfs d6619631500fe860881f162577f2f551d395ff24]
[  205.877223]  open_ctree+0x825/0x1030 [btrfs d6619631500fe860881f162577f2f551d395ff24]
[  205.877261]  btrfs_get_tree+0x58e/0x740 [btrfs d6619631500fe860881f162577f2f551d395ff24]
[  205.877297]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877300]  ? __kmalloc_node_track_caller_noprof+0x1aa/0x2a0
[  205.877304]  ? vfs_dup_fs_context+0x2d/0x1b0
[  205.877309]  vfs_get_tree+0x2b/0xd0
[  205.877313]  fc_mount+0x12/0x40
[  205.877317]  btrfs_get_tree+0x234/0x740 [btrfs d6619631500fe860881f162577f2f551d395ff24]
[  205.877354]  vfs_get_tree+0x2b/0xd0
[  205.877358]  __se_sys_fsconfig+0x50a/0x5c0
[  205.877363]  do_syscall_64+0x85/0x11e
[  205.877366]  ? mntput_no_expire.llvm.15307020400983096988+0x4d/0x220
[  205.877372]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877375]  ? syscall_exit_work+0xca/0x150
[  205.877378]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877380]  ? syscall_exit_to_user_mode+0x38/0x9f
[  205.877384]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877386]  ? do_syscall_64+0x91/0x11e
[  205.877389]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877391]  ? syscall_exit_work+0xca/0x150
[  205.877393]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877396]  ? syscall_exit_to_user_mode+0x38/0x9f
[  205.877399]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877402]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877404]  ? syscall_exit_work+0xca/0x150
[  205.877406]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877409]  ? syscall_exit_to_user_mode+0x38/0x9f
[  205.877412]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877414]  ? do_syscall_64+0x91/0x11e
[  205.877417]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877419]  ? do_syscall_64+0x91/0x11e
[  205.877422]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877424]  ? __fs_parse+0x54/0x1d0
[  205.877428]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877430]  ? btrfs_parse_param+0x54/0x8e0 [btrfs d6619631500fe860881f162577f2f551d395ff24]
[  205.877467]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877470]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877472]  ? syscall_exit_work+0xca/0x150
[  205.877475]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877477]  ? syscall_exit_to_user_mode+0x38/0x9f
[  205.877480]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877483]  ? do_syscall_64+0x91/0x11e
[  205.877486]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877488]  ? syscall_exit_to_user_mode+0x38/0x9f
[  205.877491]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877493]  ? do_syscall_64+0x91/0x11e
[  205.877496]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877498]  ? syscall_exit_to_user_mode+0x38/0x9f
[  205.877510]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877513]  ? do_syscall_64+0x91/0x11e
[  205.877515]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877517]  ? syscall_exit_to_user_mode+0x38/0x9f
[  205.877521]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877523]  ? do_syscall_64+0x91/0x11e
[  205.877526]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877528]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877531]  entry_SYSCALL_64_after_hwframe+0x76/0x7e
[  205.877534] RIP: 0033:0x7f78c97b02fe
[  205.877561] Code: 73 01 c3 48 8b 0d 12 ca 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 49 89 ca b8 af 01 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d e2 c9 0c 00 f7 d8 64 89 01 48
[  205.877564] RSP: 002b:00007fff681e2018 EFLAGS: 00000246 ORIG_RAX: 00000000000001af
[  205.877569] RAX: ffffffffffffffda RBX: 0000643d093634f0 RCX: 00007f78c97b02fe
[  205.877571] RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000003
[  205.877572] RBP: 00007fff681e2050 R08: 0000000000000000 R09: 00007f78c987db20
[  205.877574] R10: 0000000000000000 R11: 0000000000000246 R12: 00007f78c98d4aa0
[  205.877576] R13: 0000000000000000 R14: 0000643d093650a0 R15: 00007f78c98cbf9b
[  205.877581]  </TASK>
[  205.877582] ---[ end trace 0000000000000000 ]---
[  205.877701] BTRFS error (device nvme0n1p2 state E): open_ctree failed
```
Quoted 11 lines · Chris Murphy
Quoted 2 lines · Peter Jung

Thanks for your answer - but how it would work saving the logs in the emergency shell, specially if the root partitions can not be mounted?

You can mount a USB stick or even the EFI system partition to /sysroot and then copy the logs there.

Also for Qu et al, we have a couple reports in Fedora of log tree replay issues with 6.15 series too. I've requested dmesg, but at least one of the users already followed advice to zero the log tree. Hopefully we get one to report dmesg soon.

-- Chris Murphy

#8 lore raw
Quoted 5 lines · Peter Jung

Hi all,

Here you can find the trace of dmesg, after the log tree is corrupted. This has been taken on an Live ISO, which should reflect the same dmesg as in the emergency shell, when trying to mount the disk.

Thank you very much for collecting this.

Quoted 11 lines

```

[  205.774875] BTRFS: device fsid b09a027e-a61d-424f-858f-2e02be61b342 devid
1 transid 159947 /dev/nvme0n1p2 (259:2) scanned by mount (2499)
[  205.775120] BTRFS info (device nvme0n1p2): first mount of filesystem
b09a027e-a61d-424f-858f-2e02be61b342
[  205.775142] BTRFS info (device nvme0n1p2): using crc32c (crc32c-intel)
checksum algorithm
[  205.775150] BTRFS info (device nvme0n1p2): using free-space-tree
[  205.792525] BTRFS info (device nvme0n1p2): start tree-log replay
[  205.875103] BTRFS: error (device nvme0n1p2) in btrfs_replay_log:2104:
Quoted 1 line

errno=-5 IO failure (Failed to recover log tree)

What we can draw from this is that we are seeing an EIO somewhere in btrfs_replay_log()

Quoted 3 lines
[  205.876751] ------------[ cut here ]------------
[  205.876753] WARNING: CPU: 4 PID: 2499 at fs/btrfs/block-rsv.c:456

btrfs_release_global_block_rsv+0xa9/0xe0 [btrfs]

Then after that function fails, we go to the cleanup of the mount operation and also hit a WARNING in btrfs_free_block_groups(). It could be related. It's a little weird since that call fully empties the block_rsv with a -1 release before the WARN checks, so it suggests some race where someone else uses the block_rsv mid release.

I don't have a strong intuition for whether this is important or not, but best case it is a hint of what's happening on the system, it doesn't have strong relevance to the proximal causes of the log tree replay EIO.

Quoted 151 lines
[  205.876813] Modules linked in: ccm snd_seq_dummy snd_hrtimer snd_seq

snd_seq_device qrtr snd_soc_dmic snd_soc_acp6x_mach snd_acp6x_pdm_dma snd_sof_amd_acp70 snd_sof_amd_acp63 snd_sof_amd_vangogh snd_sof_amd_rembrandt snd_sof_amd_renoir snd_sof_amd_acp snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils snd_pci_ps snd_soc_acpi_amd_match soundwire_amd soundwire_generic_allocation snd_amd_sdw_acpi soundwire_bus snd_soc_sdca snd_soc_core ac97_bus snd_pcm_dmaengine snd_compress amd_atl intel_rapl_msr intel_rapl_common kvm_amd hid_sensor_custom snd_hda_codec_realtek snd_rpl_pci_acp6x snd_hda_scodec_component kvm uvcvideo snd_hda_codec_generic snd_acp_pci snd_hda_codec_hdmi snd_acp_legacy_common iwlmvm crct10dif_pclmul snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hda_core snd_pci_acp6x polyval_clmulni uvc snd_hwdep videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common videodev mc polyval_generic nvidia_drm(OE) hid_multitouch btusb spd5118 hid_sensor_hub snd_pcm mac80211

[  205.876885]  ghash_clmulni_intel snd_timer libarc4 btbcm

nvidia_modeset(OE) snd_pci_acp5x btintel snd_rn_pci_acp3x sha1_ssse3 ptp snd snd_acp_config btrtl joydev pps_core mousedev wacom iwlwifi rapl i2c_piix4 soundcore ideapad_laptop snd_soc_acpi i2c_hid_acpi ucsi_acpi btmtk cfg80211 nvidia(OE) platform_profile typec_ucsi bluetooth typec sparse_keymap roles wmi_bmof nvidia_wmi_ec_backlight k10temp rfkill amd_pmc snd_pci_acp3x ccp i2c_hid mac_hid acpi_tad i2c_smbus zfs(OE) spl(OE) pkcs8_key_parser ntsync i2c_dev nfnetlink lz4 zram 842_decompress 842_compress lz4hc_compress lz4_compress ip_tables x_tables overlay squashfs loop isofs cdrom dm_mod hid_logitech_hidpp hid_logitech_dj amdgpu nouveau btrfs mxm_wmi drm_gpuvm drm_buddy raid6_pq drm_exec amdxcp crc32_pclmul xor gpu_sched uas drm_suballoc_helper sha512_ssse3 libcrc32c crc32c_generic crc32c_intel usb_storage hid_generic serio_raw sha256_ssse3 drm_ttm_helper sdhci_pci atkbd aesni_intel ttm cqhci libps2 gf128mul vivaldi_fmap sdhci_uhs2 crypto_simd i2c_algo_bit nvme

[  205.876991]  cryptd sdhci drm_display_helper usbhid nvme_core i8042
mmc_core video cec crc16 nvme_auth serio wmi
[  205.877008] CPU: 4 UID: 0 PID: 2499 Comm: mount Tainted: G OE
6.13.0-2-cachyos #1 b109e82a9bce3931c5e96e558e71463b86410157
[  205.877013] Tainted: [O]=OOT_MODULE, [E]=UNSIGNED_MODULE
[  205.877015] Hardware name: LENOVO 82SN/LNVNB161216, BIOS J4CN44WW
01/03/2025
[  205.877017] RIP: 0010:btrfs_release_global_block_rsv+0xa9/0xe0 [btrfs]
[  205.877059] Code: 01 00 00 00 74 b1 0f 0b 48 83 bb 40 01 00 00 00 74 af
0f 0b 48 83 bb 48 01 00 00 00 74 ad 0f 0b 48 83 bb 70 01 00 00 00 74 ab <0f>
0b 48 83 bb 78 01 00 00 00 74 a9 0f 0b 48 83 bb a8 01 00 00 00
[  205.877062] RSP: 0018:ffffb1dccf0b3930 EFLAGS: 00010286
[  205.877065] RAX: 000000000aa74000 RBX: ffff9d1309b3e000 RCX:
0000000000000000
[  205.877067] RDX: 0000000000000001 RSI: ffff9d11968a8000 RDI:
ffff9d11968a8008
[  205.877069] RBP: ffff9d1309b3e000 R08: 0000000000200018 R09:
0000000000000000
[  205.877071] R10: ffffffff00000000 R11: ffff9d11a3b70d28 R12:
0000000000000000
[  205.877073] R13: ffff9d1309b3e090 R14: dead000000000122 R15:
ffff9d1309b3e098
[  205.877075] FS:  00007f78c965bb80(0000) GS:ffff9d146fe00000(0000)
knlGS:0000000000000000
[  205.877077] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  205.877079] CR2: 000077ed0d308068 CR3: 0000000105c44000 CR4:
0000000000f50ef0
[  205.877081] PKRU: 55555554
[  205.877083] Call Trace:
[  205.877085]  <TASK>
[  205.877087]  ? __warn+0xd5/0x1d0
[  205.877093]  ? btrfs_release_global_block_rsv+0xa9/0xe0 [btrfs
d6619631500fe860881f162577f2f551d395ff24]
[  205.877131]  ? report_bug+0x144/0x1f0
[  205.877137]  ? handle_bug+0x6a/0x90
[  205.877141]  ? exc_invalid_op+0x1a/0x50
[  205.877144]  ? asm_exc_invalid_op+0x1a/0x20
[  205.877151]  ? btrfs_release_global_block_rsv+0xa9/0xe0 [btrfs
d6619631500fe860881f162577f2f551d395ff24]
[  205.877187]  btrfs_free_block_groups+0x3a6/0x490 [btrfs
d6619631500fe860881f162577f2f551d395ff24]
[  205.877223]  open_ctree+0x825/0x1030 [btrfs
d6619631500fe860881f162577f2f551d395ff24]
[  205.877261]  btrfs_get_tree+0x58e/0x740 [btrfs
d6619631500fe860881f162577f2f551d395ff24]
[  205.877297]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877300]  ? __kmalloc_node_track_caller_noprof+0x1aa/0x2a0
[  205.877304]  ? vfs_dup_fs_context+0x2d/0x1b0
[  205.877309]  vfs_get_tree+0x2b/0xd0
[  205.877313]  fc_mount+0x12/0x40
[  205.877317]  btrfs_get_tree+0x234/0x740 [btrfs
d6619631500fe860881f162577f2f551d395ff24]
[  205.877354]  vfs_get_tree+0x2b/0xd0
[  205.877358]  __se_sys_fsconfig+0x50a/0x5c0
[  205.877363]  do_syscall_64+0x85/0x11e
[  205.877366]  ? mntput_no_expire.llvm.15307020400983096988+0x4d/0x220
[  205.877372]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877375]  ? syscall_exit_work+0xca/0x150
[  205.877378]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877380]  ? syscall_exit_to_user_mode+0x38/0x9f
[  205.877384]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877386]  ? do_syscall_64+0x91/0x11e
[  205.877389]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877391]  ? syscall_exit_work+0xca/0x150
[  205.877393]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877396]  ? syscall_exit_to_user_mode+0x38/0x9f
[  205.877399]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877402]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877404]  ? syscall_exit_work+0xca/0x150
[  205.877406]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877409]  ? syscall_exit_to_user_mode+0x38/0x9f
[  205.877412]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877414]  ? do_syscall_64+0x91/0x11e
[  205.877417]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877419]  ? do_syscall_64+0x91/0x11e
[  205.877422]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877424]  ? __fs_parse+0x54/0x1d0
[  205.877428]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877430]  ? btrfs_parse_param+0x54/0x8e0 [btrfs
d6619631500fe860881f162577f2f551d395ff24]
[  205.877467]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877470]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877472]  ? syscall_exit_work+0xca/0x150
[  205.877475]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877477]  ? syscall_exit_to_user_mode+0x38/0x9f
[  205.877480]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877483]  ? do_syscall_64+0x91/0x11e
[  205.877486]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877488]  ? syscall_exit_to_user_mode+0x38/0x9f
[  205.877491]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877493]  ? do_syscall_64+0x91/0x11e
[  205.877496]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877498]  ? syscall_exit_to_user_mode+0x38/0x9f
[  205.877510]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877513]  ? do_syscall_64+0x91/0x11e
[  205.877515]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877517]  ? syscall_exit_to_user_mode+0x38/0x9f
[  205.877521]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877523]  ? do_syscall_64+0x91/0x11e
[  205.877526]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877528]  ? srso_alias_return_thunk+0x5/0xfbef5
[  205.877531]  entry_SYSCALL_64_after_hwframe+0x76/0x7e
[  205.877534] RIP: 0033:0x7f78c97b02fe
[  205.877561] Code: 73 01 c3 48 8b 0d 12 ca 0c 00 f7 d8 64 89 01 48 83 c8
ff c3 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 49 89 ca b8 af 01 00 00 0f 05 <48>
3d 01 f0 ff ff 73 01 c3 48 8b 0d e2 c9 0c 00 f7 d8 64 89 01 48
[  205.877564] RSP: 002b:00007fff681e2018 EFLAGS: 00000246 ORIG_RAX:
00000000000001af
[  205.877569] RAX: ffffffffffffffda RBX: 0000643d093634f0 RCX:
00007f78c97b02fe
[  205.877571] RDX: 0000000000000000 RSI: 0000000000000006 RDI:
0000000000000003
[  205.877572] RBP: 00007fff681e2050 R08: 0000000000000000 R09:
00007f78c987db20
[  205.877574] R10: 0000000000000000 R11: 0000000000000246 R12:
00007f78c98d4aa0
[  205.877576] R13: 0000000000000000 R14: 0000643d093650a0 R15:
00007f78c98cbf9b
[  205.877581]  </TASK>
[  205.877582] ---[ end trace 0000000000000000 ]---
[  205.877701] BTRFS error (device nvme0n1p2 state E): open_ctree failed
Quoted 1 line

```

And there is no other helpful information here, unfortunately. The BZ Chris linked above is essentially the same, as far as I can tell.

So that still leaves us with very little to go off of. Would any of the following be possible with one of the people experiencing the issue:

run offline commands like btrfs check, btrfs filesystem dump-tree, etc.. on the broken fs from a live CD? We might need to hack the btrfs cli to keep trying after seeing some basic corruption, but I am happy to provide the patched btrfs-progs if necessary.

or

run some bpf tracing (preferably using bpftrace) during the failing mount? I can think about / provide my best guess of a useful script if so.

Regarding versions this is happening on: you have strong evidence it is happening on 6.15.3 but not 6.15.2? It could still be a coincidence, where we are triggering some ancient latent bug, but I will also inspect the patches you linked more carefully if so.

Thanks,
Boris

Quoted 16 lines · Chris Murphy
Quoted 11 lines · Peter Jung
Quoted 3 lines

Thanks for your answer - but how it would work saving the logs in the emergency shell, specially if the root partitions can not be mounted?

You can mount a USB stick or even the EFI system partition to /sysroot and then copy the logs there.

Also for Qu et al, we have a couple reports in Fedora of log tree replay issues with 6.15 series too. I've requested dmesg, but at least one of the users already followed advice to zero the log tree. Hopefully we get one to report dmesg soon.

-- Chris Murphy

#9 lore raw
In reply to Qu Wenruo
Quoted 41 lines · Qu Wenruo
Quoted 27 lines · Peter Jung

Hi all,

There has been increased reports of users reporting that they could not boot into their system anymore - sometimes after a needed force shutdown, but also according the users after a normal shutdown/reboot process.

The filesystem can be accessible again, after running following command in the chroot:

```
sudo btrfs rescue zero-log /dev/sdX
```

There is no way to reproduce this constantly.

Following commits did land in 6.15.3:

btrfs: exit after state insertion failure at btrfs_convert_extent_bit()
btrfs: exit after state split error at set_extent_bit()
btrfs: fix fsync of files with no hard links not persisting deletion
btrfs: fix invalid data space release when truncating block in NOCOW mode
btrfs: fix wrong start offset for delalloc space release during mmap write
btrfs: scrub: fix a wrong error type when metadata bytenr mismatches
btrfs: scrub: update device stats when an error is detected

Quoted 10 lines

Some reports:
https://discussion.fedoraproject.org/t/fedora-kde-no-longer-booting-
likely-filesystem-btrfs-corruption/157232/10
https://www.reddit.com/r/cachyos/comments/1lmzmm4/
failed_to_mount_on_real_rooted/
https://www.reddit.com/r/cachyos/comments/1llin1n/
error_failed_to_mount_uuid_on_real_root_cant_boot/
https://www.reddit.com/r/cachyos/comments/1llrpcb/
unable_to_boot_os_you_are_in_emergency_mode/
https://www.reddit.com/r/cachyos/comments/1lr5nro/my_cachyos_is_down/

Quoted 7 lines

Unfortunately none of those comment is helpful.

They do not provide the dmesg of the mount failure, and that's the most important info.

If you got any new reports, please ask for the dmesg of inside the emergency shell.

I think this is likely the same problem I ran into[1], and I collected dmesg and a dump of TREE_LOG in the bad state.

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

Thanks,

Russell

#10 lore raw

From that dump:

Quoted 2 lines
        item 0 key (TREE_LOG ROOT_ITEM 256) itemoff 15844 itemsize 439
                generation 456818 root_dirid 0 bytenr 202645028864 byte_limit 0 bytes_used 0

...

Quoted 2 lines
        item 1 key (TREE_LOG ROOT_ITEM 258) itemoff 15405 itemsize 439
                generation 456818 root_dirid 0 bytenr 202650877952 byte_limit 0 bytes_used 65536

"bytes_used 0" for the first one looks suspect to me. Maybe the problem is that if you're doing fsync I/O to multiple subvolumes, the leaves are potentially getting put in the wrong tree?

Quoted 61 lines · Russell Haley
Quoted 41 lines · Qu Wenruo
Quoted 27 lines · Peter Jung

Hi all,

There has been increased reports of users reporting that they could not boot into their system anymore - sometimes after a needed force shutdown, but also according the users after a normal shutdown/reboot process.

The filesystem can be accessible again, after running following command in the chroot:

```
sudo btrfs rescue zero-log /dev/sdX
```

There is no way to reproduce this constantly.

Following commits did land in 6.15.3:

btrfs: exit after state insertion failure at btrfs_convert_extent_bit()
btrfs: exit after state split error at set_extent_bit()
btrfs: fix fsync of files with no hard links not persisting deletion
btrfs: fix invalid data space release when truncating block in NOCOW mode
btrfs: fix wrong start offset for delalloc space release during mmap write
btrfs: scrub: fix a wrong error type when metadata bytenr mismatches
btrfs: scrub: update device stats when an error is detected

Quoted 10 lines

Some reports:
https://discussion.fedoraproject.org/t/fedora-kde-no-longer-booting-
likely-filesystem-btrfs-corruption/157232/10
https://www.reddit.com/r/cachyos/comments/1lmzmm4/
failed_to_mount_on_real_rooted/
https://www.reddit.com/r/cachyos/comments/1llin1n/
error_failed_to_mount_uuid_on_real_root_cant_boot/
https://www.reddit.com/r/cachyos/comments/1llrpcb/
unable_to_boot_os_you_are_in_emergency_mode/
https://www.reddit.com/r/cachyos/comments/1lr5nro/my_cachyos_is_down/

Quoted 7 lines

Unfortunately none of those comment is helpful.

They do not provide the dmesg of the mount failure, and that's the most important info.

If you got any new reports, please ask for the dmesg of inside the emergency shell.

I think this is likely the same problem I ran into[1], and I collected dmesg and a dump of TREE_LOG in the bad state.

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

Thanks,

Russell