Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [BUG] cow_file_range failed and kernel panic on zoned device
@ 2026-07-21 11:46 HAN Yuwei
  2026-07-21 15:29 ` Johannes Thumshirn
  0 siblings, 1 reply; 3+ messages in thread
From: HAN Yuwei @ 2026-07-21 11:46 UTC (permalink / raw)
  To: linux-btrfs

Hi all,
I have received a report from a user stating kernel panic when writing 
to HM-SMR HDD in 1TiB. The user used "mkfs.btrfs -f /dev/sdX" to create 
a new volume. And he tested xfs on the same device without any issue.

Reported-By: LUO Xiang <luoxiang221@mails.ucas.ac.cn>
HDD Model:Seagate ST18000NM009J
uname -a:Linux pro69 7.1.3-arch2-2 #1 SMP PREEMPT_DYNAMIC Thu, 16 Jul 
2026 17:41:28 +0000 x86_64 GNU/Linux
btrfs-progs: local/btrfs-progs 7.1-1
dmesg:
[redacted]
Jul 19 21:28:13 pro69 kernel: BTRFS error (device sde): cow_file_range 
failed, root=5 inode=268 start=63255040000 len=688128 
cur_offset=63255040000 cur_alloc_size=0: -28
Jul 19 21:28:13 pro69 kernel: BTRFS error (device sde): cow_file_range 
failed, root=5 inode=268 start=63255728128 len=688128 
cur_offset=63255728128 cur_alloc_size=0: -28
Jul 19 21:28:13 pro69 kernel: BTRFS error (device sde): cow_file_range 
failed, root=5 inode=268 start=63256416256 len=688128 
cur_offset=63256416256 cur_alloc_size=0: -28
Jul 19 21:28:37 pro69 kernel: _btrfs_printk: 303 callbacks suppressed
Jul 19 21:28:37 pro69 kernel: BTRFS error (device sde): error while 
writing out transaction: -11
Jul 19 21:28:37 pro69 kernel: BTRFS warning (device sde): Skipping 
commit of aborted transaction.
Jul 19 21:28:37 pro69 kernel: ------------[ cut here ]------------
Jul 19 21:28:37 pro69 kernel: BTRFS: Transaction aborted (error -11)
Jul 19 21:28:37 pro69 kernel: WARNING: fs/btrfs/transaction.c:2067 at 
btrfs_commit_transaction+0xa7c/0xde0, CPU#11: btrfs-transacti/8799
Jul 19 21:28:37 pro69 kernel: Modules linked in: nf_conntrack_netlink 
xt_nat xt_tcpudp veth xt_conntrack xt_MASQUERADE xfrm_user xfrm_algo 
xt_set ip_set xt_addrtype nft_compat x_tables rpcrdma rdma_cm iw_cm 
ib_cm ib_core ccm rfcomm snd_seq_dummy snd_hrtimer snd_seq 
snd_seq_device nft_masq nft_ct nft_reject_ipv4 nf_reject_ipv4 nft_reject 
act_csum cls_u32 sch_htb nft_chain_nat nf_nat nf_conntrack 
nf_defrag_ipv6 nf_defrag_ipv4 nf_tables nfnetlink overlay bonding tls 
bridge stp llc snd_ctl_led algif_hash algif_skcipher af_alg bnep uinput 
snd_hda_codec_intelhdmi snd_hda_codec_alc882 snd_hda_codec_realtek_lib 
snd_hda_codec_generic drm_gpusvm_helper drm_gpuvm snd_sof_pci_intel_tgl 
snd_sof_pci_intel_cnl snd_sof_intel_hda_generic soundwire_intel 
snd_sof_intel_hda_sdw_bpt snd_sof_intel_hda_common snd_soc_hdac_hda 
snd_sof_intel_hda_mlink snd_sof_intel_hda soundwire_cadence snd_sof_pci 
snd_sof_xtensa_dsp snd_sof intel_rapl_msr snd_sof_utils 
intel_rapl_common snd_soc_acpi_intel_match intel_uncore_frequency 
snd_soc_acpi_intel_sdca_quirks
Jul 19 21:28:37 pro69 kernel:  soundwire_generic_allocation 
intel_uncore_frequency_common snd_soc_sdw_utils snd_soc_acpi 
intel_tcc_cooling x86_pkg_temp_thermal soundwire_bus intel_powerclamp 
snd_soc_sdca coretemp crc8 iwlmvm snd_soc_avs vfat snd_hda_codec_atihdmi 
fat amdgpu kvm_intel snd_soc_hda_codec mac80211 snd_hda_codec_hdmi i915 
snd_hda_intel snd_hda_ext_core libarc4 kvm snd_hda_codec snd_soc_core 
asus_armoury btusb snd_hda_core amdxcp btmtk aesni_intel 
drm_panel_backlight_quirks snd_compress snd_intel_dspcfg iwlwifi 
gpu_sched ac97_bus btrtl snd_intel_sdw_acpi gf128mul drm_exec 
snd_pcm_dmaengine snd_hwdep firmware_attributes_class iTCO_wdt rapl 
eeepc_wmi btbcm ucsi_acpi drm_suballoc_helper btintel asus_wmi spd5118 
snd_pcm mei_hdcp atlantic mei_pxp typec_ucsi intel_cstate intel_pmc_bxt 
drm_buddy drm_ttm_helper sparse_keymap wmi_bmof cfg80211 bluetooth igc 
snd_timer macsec ttm i2c_i801 roles mei_me ptp snd spi_nor intel_oc_wdt 
i2c_algo_bit i2c_smbus typec soundcore intel_uncore mtd pps_core pcspkr 
i2c_mux aead drm_display_helper
Jul 19 21:28:37 pro69 kernel:  rfkill intel_pmc_core mei thunderbolt 
pmt_telemetry cec pmt_discovery pmt_class intel_gtt 
intel_pmc_ssram_telemetry joydev mousedev video pinctrl_alderlake 
intel_vsec acpi_pad acpi_tad wmi mac_hid nfsd auth_rpcgss nfs_acl lockd 
grace nfs_localio sunrpc i2c_dev dm_mod pkcs8_key_parser crypto_user 
ntsync uhid zram 842_decompress 842_compress lz4hc_compress lz4_compress 
hid_uclogic hid_multitouch nvme nvme_core intel_lpss_pci nvme_keyring 
intel_lpss spi_intel_pci nvme_auth spi_intel vmd idma64 vfio_pci 
vfio_pci_core irqbypass vfio_iommu_type1 vfio iommufd
Jul 19 21:28:37 pro69 kernel: CPU: 11 UID: 0 PID: 8799 Comm: 
btrfs-transacti Tainted: G     U              7.1.3-arch2-2 #1 
PREEMPT(full)  cf81b9d1a4a39be4b5e92e0c1c96594e14e8e6c8
Jul 19 21:28:37 pro69 kernel: Tainted: [U]=USER
Jul 19 21:28:37 pro69 kernel: Hardware name: ASUS System Product 
Name/ProArt Z690-CREATOR WIFI, BIOS 4101 12/03/2024
Jul 19 21:28:37 pro69 kernel: RIP: 0010:btrfs_commit_transaction+0xa7e/0xde0
Jul 19 21:28:37 pro69 kernel: Code: ff 48 8b 7c 24 08 31 c9 48 8d b7 48 
01 00 00 e8 f8 e6 0b 00 48 c7 43 18 00 00 00 00 e9 89 fe ff ff 48 8d 3d 
c4 1d 14 02 89 ee <67> 48 0f b9 3a 41 be 01 00 00 00 e9 fc fe ff ff 49 
8b bc 24 48 03
Jul 19 21:28:37 pro69 kernel: RSP: 0018:ffffd29d0fadbe28 EFLAGS: 00010246
Jul 19 21:28:37 pro69 kernel: RAX: 0000000000000013 RBX: 
ffff8f52847605c0 RCX: 0000000000000027
Jul 19 21:28:37 pro69 kernel: RDX: 0000000002040001 RSI: 
00000000fffffff5 RDI: ffffffffbdd0d240
Jul 19 21:28:37 pro69 kernel: RBP: 00000000fffffff5 R08: 
0000000000000000 R09: ffffffffbe75e480
Jul 19 21:28:37 pro69 kernel: R10: ffffd29d0fadbc30 R11: 
ffffd29d0fadbc28 R12: ffff8f528263e000
Jul 19 21:28:37 pro69 kernel: R13: ffff8f528c873a00 R14: 
ffff8f528c873a00 R15: ffff8f5284760628
Jul 19 21:28:37 pro69 kernel: FS:  0000000000000000(0000) 
GS:ffff8f5a60e11000(0000) knlGS:0000000000000000
Jul 19 21:28:37 pro69 kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 
0000000080050033
Jul 19 21:28:37 pro69 kernel: CR2: 000055bb0521a008 CR3: 
0000000761c22002 CR4: 0000000000f72ef0
Jul 19 21:28:37 pro69 kernel: PKRU: 55555554
Jul 19 21:28:37 pro69 kernel: Call Trace:
Jul 19 21:28:37 pro69 kernel:  <TASK>
Jul 19 21:28:37 pro69 kernel:  transaction_kthread+0x152/0x1c0
Jul 19 21:28:37 pro69 kernel:  ? __pfx_transaction_kthread+0x10/0x10
Jul 19 21:28:37 pro69 kernel:  kthread+0xe4/0x120
Jul 19 21:28:37 pro69 kernel:  ? __pfx_kthread+0x10/0x10
Jul 19 21:28:37 pro69 kernel:  ret_from_fork+0x2a7/0x330
Jul 19 21:28:37 pro69 kernel:  ? __pfx_kthread+0x10/0x10
Jul 19 21:28:37 pro69 kernel:  ret_from_fork_asm+0x1a/0x30
Jul 19 21:28:37 pro69 kernel:  </TASK>
Jul 19 21:28:37 pro69 kernel: ---[ end trace 0000000000000000 ]---
Jul 19 21:28:37 pro69 kernel: BTRFS: error (device sde state A) in 
cleanup_transaction:2067: errno=-11 unknown
Jul 19 21:28:37 pro69 kernel: BTRFS info (device sde state EA): forced 
readonly
Jul 19 21:29:08 pro69 kernel: BTRFS error (device sde state EA): 
cow_file_range failed, root=5 inode=268 start=68295892992 len=688128 
cur_offset=68295892992 cur_alloc_size=0: -30
Jul 19 21:29:08 pro69 kernel: writepage_delalloc: 383 callbacks suppressed
Jul 19 21:29:08 pro69 kernel: BTRFS error (device sde state EA): failed 
to run delalloc range, root=5 ino=268 folio=68295892992 submit_bitmap=0 
start=68295892992 len=688128: -30

the full dmesg can be retreived if interested.

HAN Yuwei


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG] cow_file_range failed and kernel panic on zoned device
  2026-07-21 11:46 [BUG] cow_file_range failed and kernel panic on zoned device HAN Yuwei
@ 2026-07-21 15:29 ` Johannes Thumshirn
  2026-07-22 11:38   ` Johannes Thumshirn
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Thumshirn @ 2026-07-21 15:29 UTC (permalink / raw)
  To: HAN Yuwei; +Cc: linux-btrfs, Naohiro Aota

On Tue, Jul 21, 2026 at 07:46:53PM +0800, HAN Yuwei wrote:
> Hi all,
> I have received a report from a user stating kernel panic when writing to
> HM-SMR HDD in 1TiB. The user used "mkfs.btrfs -f /dev/sdX" to create a new
> volume. And he tested xfs on the same device without any issue.
> 
> Reported-By: LUO Xiang <luoxiang221@mails.ucas.ac.cn>
> HDD Model:Seagate ST18000NM009J
> uname -a:Linux pro69 7.1.3-arch2-2 #1 SMP PREEMPT_DYNAMIC Thu, 16 Jul 2026
> 17:41:28 +0000 x86_64 GNU/Linux
> btrfs-progs: local/btrfs-progs 7.1-1
> dmesg:
> [redacted]

[snip]

> Jul 19 21:28:37 pro69 kernel: BTRFS: error (device sde state A) in
> cleanup_transaction:2067: errno=-11 unknown
> Jul 19 21:28:37 pro69 kernel: BTRFS info (device sde state EA): forced
> readonly
> Jul 19 21:29:08 pro69 kernel: BTRFS error (device sde state EA):
> cow_file_range failed, root=5 inode=268 start=68295892992 len=688128
> cur_offset=68295892992 cur_alloc_size=0: -30
> Jul 19 21:29:08 pro69 kernel: writepage_delalloc: 383 callbacks suppressed
> Jul 19 21:29:08 pro69 kernel: BTRFS error (device sde state EA): failed to
> run delalloc range, root=5 ino=268 folio=68295892992 submit_bitmap=0
> start=68295892992 len=688128: -30
> 
> the full dmesg can be retreived if interested.

I /think/ I know the source of the problem. Errno 11 is EAGAIN and from
writepage_delalloc() it means we've hit a "hole" or out-of-order
metadata. This is exactly the kind of bug I'm trying to fix for 2 weeks
now. Not sure why it surfaces now but I see it failing in my fstests
setups as well.

There's some hotfix attempts to it and I *hope* I have something
upstream acceptible as well soon.

This is a BTRFS specific sequential metadata thing XFS will not see
because XFS is not putting metadata on sequential zones. 

I hope I can give you something to try by the end of the week.

Byte,
	Johannes

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG] cow_file_range failed and kernel panic on zoned device
  2026-07-21 15:29 ` Johannes Thumshirn
@ 2026-07-22 11:38   ` Johannes Thumshirn
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2026-07-22 11:38 UTC (permalink / raw)
  To: HAN Yuwei; +Cc: linux-btrfs, Naohiro Aota

On Tue, Jul 21, 2026 at 05:29:06PM +0200, Johannes Thumshirn wrote:
> On Tue, Jul 21, 2026 at 07:46:53PM +0800, HAN Yuwei wrote:
> > Hi all,
> > I have received a report from a user stating kernel panic when writing to
> > HM-SMR HDD in 1TiB. The user used "mkfs.btrfs -f /dev/sdX" to create a new
> > volume. And he tested xfs on the same device without any issue.
> > 
> > Reported-By: LUO Xiang <luoxiang221@mails.ucas.ac.cn>
> > HDD Model:Seagate ST18000NM009J
> > uname -a:Linux pro69 7.1.3-arch2-2 #1 SMP PREEMPT_DYNAMIC Thu, 16 Jul 2026
> > 17:41:28 +0000 x86_64 GNU/Linux
> > btrfs-progs: local/btrfs-progs 7.1-1
> > dmesg:
> > [redacted]
> 
> [snip]
> 
> > Jul 19 21:28:37 pro69 kernel: BTRFS: error (device sde state A) in
> > cleanup_transaction:2067: errno=-11 unknown
> > Jul 19 21:28:37 pro69 kernel: BTRFS info (device sde state EA): forced
> > readonly
> > Jul 19 21:29:08 pro69 kernel: BTRFS error (device sde state EA):
> > cow_file_range failed, root=5 inode=268 start=68295892992 len=688128
> > cur_offset=68295892992 cur_alloc_size=0: -30
> > Jul 19 21:29:08 pro69 kernel: writepage_delalloc: 383 callbacks suppressed
> > Jul 19 21:29:08 pro69 kernel: BTRFS error (device sde state EA): failed to
> > run delalloc range, root=5 ino=268 folio=68295892992 submit_bitmap=0
> > start=68295892992 len=688128: -30
> > 
> > the full dmesg can be retreived if interested.
> 
> I /think/ I know the source of the problem. Errno 11 is EAGAIN and from
> writepage_delalloc() it means we've hit a "hole" or out-of-order
> metadata. This is exactly the kind of bug I'm trying to fix for 2 weeks
> now. Not sure why it surfaces now but I see it failing in my fstests
> setups as well.
> 
> There's some hotfix attempts to it and I *hope* I have something
> upstream acceptible as well soon.
> 
> This is a BTRFS specific sequential metadata thing XFS will not see
> because XFS is not putting metadata on sequential zones. 
> 
> I hope I can give you something to try by the end of the week.

Here we go: https://lore.kernel.org/linux-btrfs/20260722113016.1896990-1-johannes.thumshirn@wdc.com/T/#me996c86cd69671aee67455dfefccf29062ff222f

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-22 11:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-21 11:46 [BUG] cow_file_range failed and kernel panic on zoned device HAN Yuwei
2026-07-21 15:29 ` Johannes Thumshirn
2026-07-22 11:38   ` Johannes Thumshirn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox