Lots of warnings in the journal coming from btrfs_rename (fs/btrfs/inode.c)

In the journalctl I see lots of warnings like shown below but I don’t see any statement describing the cause for the warning.
What is this warning about?
How can I fix this?

I have Fedora 40 but I’ve seen these warnings in a couple of previous Fedora versions too.

sie 09 11:42:58 myhost kernel: ------------[ cut here ]------------
sie 09 11:42:58 myhost kernel: WARNING: CPU: 3 PID: 100250 at fs/btrfs/inode.c:9107 btrfs_rename+0x3f6/0x8e0
sie 09 11:42:58 myhost kernel: Modules linked in: xt_nat veth nf_conntrack_netlink xt_addrtype br_netfilter overlay uinput snd_seq_dummy snd_hrtimer vboxnetadp(OE) vboxnetflt(OE) vboxdrv(OE) nvidia_drm(POE) nvidia_modeset(POE) xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4 nvidia_uvm(POE) ip6table_mangle ip6table_nat ip6table_filter ip6_tables iptable_mangle iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 iptable_filter ip_tables qrtr bridge stp llc nvidia(POE) sunrpc intel_rapl_msr intel_rapl_common x86_pkg_temp_thermal intel_powerclamp at24 snd_hda_codec_realtek snd_hda_codec_hdmi mei_wdt snd_hda_codec_generic snd_hda_scodec_component snd_hda_intel snd_intel_dspcfg coretemp snd_intel_sdw_acpi mei_pxp snd_hda_codec kvm_intel mei_hdcp ppdev iTCO_wdt intel_pmc_bxt iTCO_vendor_support kvm snd_hda_core snd_hwdep rapl intel_cstate intel_uncore snd_seq pcspkr i2c_i801 i2c_smbus hid_logitech_hidpp snd_seq_device joydev snd_pcm pktcdvd snd_timer r8169 snd mei_me realtek mei lpc_ich soundcore parport_pc parport
sie 09 11:42:58 myhost kernel:  cfg80211 rfkill loop dm_multipath nfnetlink hid_logitech_dj crct10dif_pclmul crc32_pclmul crc32c_intel polyval_clmulni polyval_generic ghash_clmulni_intel sha512_ssse3 sha256_ssse3 sha1_ssse3 video wmi scsi_dh_rdac scsi_dh_emc scsi_dh_alua fuse i2c_dev
sie 09 11:42:58 myhost kernel: CPU: 3 PID: 100250 Comm: ThreadPoolForeg Tainted: P        W  OE      6.9.12-200.fc40.x86_64 #1
sie 09 11:42:58 myhost kernel: Hardware name: MSI MS-7798/B75MA-P45 (MS-7798), BIOS V1.3 07/30/2012
sie 09 11:42:58 myhost kernel: RIP: 0010:btrfs_rename+0x3f6/0x8e0
sie 09 11:42:58 myhost kernel: Code: 60 48 89 04 24 48 05 f0 09 00 00 f0 48 0f ba 28 02 0f 82 25 c5 a7 00 e9 f4 c4 a7 00 83 f8 ef 75 0b 4d 85 ff 0f 85 be fd ff ff <0f> 0b 48 8b 7c 24 68 89 0c 24 e8 4b a3 da ff 48 8b bc 24 a0 00 00
sie 09 11:42:58 myhost kernel: RSP: 0018:ffffa2f9c844fb58 EFLAGS: 00010246
sie 09 11:42:58 myhost kernel: RAX: 00000000ffffffef RBX: ffff8d66ec9d0a50 RCX: 00000000ffffffef
sie 09 11:42:58 myhost kernel: RDX: 0000001782fae003 RSI: 00000000000436d0 RDI: 38ae07c5668dffff
sie 09 11:42:58 myhost kernel: RBP: ffff8d66ec9d0a50 R08: 0000000000000000 R09: 00000000000038dd
sie 09 11:42:58 myhost kernel: R10: 0000000000000001 R11: ffffa2f9c844fb07 R12: ffff8d65d6d413c0
sie 09 11:42:58 myhost kernel: R13: ffff8d65f9a85318 R14: ffff8d66c12ba000 R15: 0000000000000000
sie 09 11:42:58 myhost kernel: FS:  00007f995ec006c0(0000) GS:ffff8d67d5d80000(0000) knlGS:0000000000000000
sie 09 11:42:58 myhost kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
sie 09 11:42:58 myhost kernel: CR2: 0000559321caf000 CR3: 00000000cda52006 CR4: 00000000001706f0
sie 09 11:42:58 myhost kernel: Call Trace:
sie 09 11:42:58 myhost kernel:  <TASK>
sie 09 11:42:58 myhost kernel:  ? btrfs_rename+0x3f6/0x8e0
sie 09 11:42:58 myhost kernel:  ? __warn.cold+0x8e/0xe8
sie 09 11:42:58 myhost kernel:  ? btrfs_rename+0x3f6/0x8e0
sie 09 11:42:58 myhost kernel:  ? report_bug+0xff/0x140
sie 09 11:42:58 myhost kernel:  ? handle_bug+0x3c/0x80
sie 09 11:42:58 myhost kernel:  ? exc_invalid_op+0x17/0x70
sie 09 11:42:58 myhost kernel:  ? asm_exc_invalid_op+0x1a/0x20
sie 09 11:42:58 myhost kernel:  ? btrfs_rename+0x3f6/0x8e0
sie 09 11:42:58 myhost kernel:  ? btrfs_rename+0x1a5/0x8e0
sie 09 11:42:58 myhost kernel:  ? avc_has_extended_perms+0x550/0x550
sie 09 11:42:58 myhost kernel:  btrfs_rename2+0x2e/0x70
sie 09 11:42:58 myhost kernel:  vfs_rename+0xa2a/0xfd0
sie 09 11:42:58 myhost kernel:  ? current_check_refer_path+0x35/0x2c0
sie 09 11:42:58 myhost kernel:  ? do_renameat2+0x5e9/0x620
sie 09 11:42:58 myhost kernel:  do_renameat2+0x5e9/0x620
sie 09 11:42:58 myhost kernel:  __x64_sys_rename+0x78/0xb0
sie 09 11:42:58 myhost kernel:  do_syscall_64+0x82/0x160
sie 09 11:42:58 myhost kernel:  ? irqtime_account_irq+0x3e/0xc0
sie 09 11:42:58 myhost kernel:  ? __irq_exit_rcu+0x4a/0xb0
sie 09 11:42:58 myhost kernel:  entry_SYSCALL_64_after_hwframe+0x76/0x7e
sie 09 11:42:58 myhost kernel: RIP: 0033:0x7f9969a8205b
sie 09 11:42:58 myhost kernel: Code: c0 48 8b 5d f8 c9 c3 0f 1f 84 00 00 00 00 00 b8 ff ff ff ff eb eb 66 0f 1f 84 00 00 00 00 00 f3 0f 1e fa b8 52 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 8b 15 89 4d 18 00 f7 d8
sie 09 11:42:58 myhost kernel: RSP: 002b:00007f995ebfd8e8 EFLAGS: 00000282 ORIG_RAX: 0000000000000052
sie 09 11:42:58 myhost kernel: RAX: ffffffffffffffda RBX: 00007f995ebfda7c RCX: 00007f9969a8205b
sie 09 11:42:58 myhost kernel: RDX: 0000000000000070 RSI: 0000394000cb79d0 RDI: 0000394001629650
sie 09 11:42:58 myhost kernel: RBP: 00007f995ebfd980 R08: 00000000002c533c R09: 000000000000003d
sie 09 11:42:58 myhost kernel: R10: 0000000000000000 R11: 0000000000000282 R12: 00007f995ebfd910
sie 09 11:42:58 myhost kernel: R13: 00007f995ebfd8f0 R14: 0000394000cb79d0 R15: 0000394001629650
sie 09 11:42:58 myhost kernel:  </TASK>
sie 09 11:42:58 myhost kernel: ---[ end trace 0000000000000000 ]---

They are kernel panics and suggest a serious problem.

Suggest you raise a bug ticket against the linux kernel so maintainers may help. See How to file a bug :: Fedora Docs

As shown in the log my kernel is tained (Tainted: P W OE) because of nvidia modules. In the past I raised issue against kernel and was told nobody is going to investigate the reason as long as the kernel is tained.

Reproduce the problem using the nouveau driver and the report will not be rejected for tainting. Then go back to using the nvidia driver.

It is not hard to switch back and forth between nouveau and Nvidia.

Added btrfs