[50196.237292] run fstests generic/251 at 2023-07-15 10:52:57
[50196.672323] BTRFS: device fsid ec3e1159-917e-46d6-82d2-6d36aac552b0 devid 1 transid 2321883 /dev/mapper/vg0-lv0 scanned by mount (3811133)
[50196.673504] BTRFS info (device dm-0): using crc32c (crc32c-intel) checksum algorithm
[50196.673510] BTRFS info (device dm-0): using free space tree
[50196.677246] BTRFS info (device dm-0): auto enabling async discard
[50196.883144] BTRFS: device fsid e40f0525-465a-480c-b87d-8b25f355e990 devid 1 transid 6 /dev/mapper/vg0-lv9 scanned by mkfs.btrfs (3811181)
[50196.929582] BTRFS info (device dm-9): using crc32c (crc32c-intel) checksum algorithm
[50196.929594] BTRFS info (device dm-9): turning on sync discard
[50196.929598] BTRFS info (device dm-9): enabling free space tree
[50196.929601] BTRFS info (device dm-9): using free space tree
[50196.941167] BTRFS info (device dm-9): creating free space tree
[50196.942138] BTRFS info (device dm-9): setting compat-ro feature flag for FREE_SPACE_TREE (0x1)
[50196.942145] BTRFS info (device dm-9): setting compat-ro feature flag for FREE_SPACE_TREE_VALID (0x2)
[50196.951860] BTRFS info (device dm-9): cleaning free space cache v1
[50196.959843] BTRFS info (device dm-9): checking UUID tree
[50529.124484] ======================================================
[50529.124736] WARNING: possible circular locking dependency detected
[50529.125033] 6.5.0-rc1+ #1240 Not tainted
[50529.125199] ------------------------------------------------------
[50529.125469] kswapd0/47 is trying to acquire lock:
[50529.125665] ffff9a3097096378 (btrfs_trans_num_writers){++++}-{0:0}, at: join_transaction+0x19f/0x550
[50529.126041]
but task is already holding lock:
[50529.126280] ffff9a30a4363600 (sb_internal#2){++++}-{0:0}, at: btrfs_commit_inode_delayed_inode+0x5f/0x120
[50529.126669]
which lock already depends on the new lock.
[50529.126998]
the existing dependency chain (in reverse order) is:
[50529.127303]
-> #3 (sb_internal#2){++++}-{0:0}:
[50529.127548] start_transaction+0x401/0x730
[50529.127743] btrfs_commit_inode_delayed_inode+0x5f/0x120
[50529.127984] btrfs_evict_inode+0x273/0x3c0
[50529.128185] evict+0xcc/0x1d0
[50529.128335] inode_lru_isolate+0x14d/0x1e0
[50529.128529] __list_lru_walk_one+0xbe/0x1c0
[50529.128727] list_lru_walk_one+0x58/0x80
[50529.128914] prune_icache_sb+0x39/0x60
[50529.129143] super_cache_scan+0x161/0x1f0
[50529.129334] do_shrink_slab+0x163/0x340
[50529.129518] shrink_slab+0x1d7/0x2a0
[50529.129693] shrink_node+0x2eb/0x7b0
[50529.129864] balance_pgdat+0x344/0x780
[50529.130051] kswapd+0x205/0x410
[50529.130208] kthread+0xfc/0x130
[50529.130377] ret_from_fork+0x29/0x50
[50529.130543]
-> #2 (fs_reclaim){+.+.}-{0:0}:
[50529.130772] fs_reclaim_acquire+0xa5/0xe0
[50529.130958] kmem_cache_alloc_lru+0x4e/0x570
[50529.131156] btrfs_alloc_inode+0x2d/0x250
[50529.131340] alloc_inode+0x1a/0xc0
[50529.131502] iget5_locked+0xba/0x110
[50529.131668] btrfs_iget+0x43/0xe0
[50529.131825] create_reloc_inode+0x19d/0x370
[50529.132017] btrfs_relocate_block_group+0x1b7/0x410
[50529.132239] btrfs_relocate_chunk+0x4c/0x190
[50529.132435] btrfs_balance+0x8e7/0x11d0
[50529.132614] btrfs_ioctl+0x1d3d/0x2900
[50529.132790] __x64_sys_ioctl+0x8b/0xc0
[50529.132966] do_syscall_64+0x38/0x90
[50529.133136] entry_SYSCALL_64_after_hwframe+0x6e/0xd8
[50529.133361]
-> #1 (btrfs_trans_num_extwriters){++++}-{0:0}:
[50529.133641] join_transaction+0xdb/0x550
[50529.133823] start_transaction+0x24f/0x730
[50529.134012] btrfs_uuid_scan_kthread+0x2bc/0x3d0
[50529.134222] kthread+0xfc/0x130
[50529.134374] ret_from_fork+0x29/0x50
[50529.134543]
-> #0 (btrfs_trans_num_writers){++++}-{0:0}:
[50529.134811] __lock_acquire+0x1415/0x2190
[50529.134997] lock_acquire+0xc7/0x2b0
[50529.135166] join_transaction+0x1cd/0x550
[50529.135381] start_transaction+0x24f/0x730
[50529.135646] btrfs_commit_inode_delayed_inode+0x5f/0x120
[50529.136012] btrfs_evict_inode+0x273/0x3c0
[50529.136290] evict+0xcc/0x1d0
[50529.136508] inode_lru_isolate+0x14d/0x1e0
[50529.136806] __list_lru_walk_one+0xbe/0x1c0
[50529.137108] list_lru_walk_one+0x58/0x80
[50529.137414] prune_icache_sb+0x39/0x60
[50529.137676] super_cache_scan+0x161/0x1f0
[50529.137941] do_shrink_slab+0x163/0x340
[50529.138202] shrink_slab+0x1d7/0x2a0
[50529.138457] shrink_node+0x2eb/0x7b0
[50529.138704] balance_pgdat+0x344/0x780
[50529.138966] kswapd+0x205/0x410
[50529.139182] kthread+0xfc/0x130
[50529.139404] ret_from_fork+0x29/0x50
[50529.139651]
other info that might help us debug this:
[50529.140122] Chain exists of:
btrfs_trans_num_writers --> fs_reclaim --> sb_internal#2
[50529.140732] Possible unsafe locking scenario:
[50529.141076] CPU0 CPU1
[50529.141323] ---- ----
[50529.141583] rlock(sb_internal#2);
[50529.141794] lock(fs_reclaim);
[50529.142111] lock(sb_internal#2);
[50529.142460] rlock(btrfs_trans_num_writers);
[50529.142704]
*** DEADLOCK ***
[50529.143036] 4 locks held by kswapd0/47:
[50529.143244] #0: ffffffffaee62280 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x492/0x780
[50529.143691] #1: ffffffffaee507d0 (shrinker_rwsem){++++}-{3:3}, at: shrink_slab+0x113/0x2a0
[50529.144134] #2: ffff9a30a43630e0 (&type->s_umount_key#45){++++}-{3:3}, at: super_cache_scan+0x38/0x1f0
[50529.144639] #3: ffff9a30a4363600 (sb_internal#2){++++}-{0:0}, at: btrfs_commit_inode_delayed_inode+0x5f/0x120
[50529.145204]
stack backtrace:
[50529.145442] CPU: 1 PID: 47 Comm: kswapd0 Not tainted 6.5.0-rc1+ #1240
[50529.145797] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014
[50529.146240] Call Trace:
[50529.146378]
[50529.146498] dump_stack_lvl+0x58/0x90
[50529.146715] check_noncircular+0x101/0x110
[50529.146941] __lock_acquire+0x1415/0x2190
[50529.147194] lock_acquire+0xc7/0x2b0
[50529.147416] ? join_transaction+0x19f/0x550
[50529.147634] ? lock_release+0x134/0x270
[50529.147843] join_transaction+0x1cd/0x550
[50529.148075] ? join_transaction+0x19f/0x550
[50529.148291] start_transaction+0x24f/0x730
[50529.148510] btrfs_commit_inode_delayed_inode+0x5f/0x120
[50529.148779] btrfs_evict_inode+0x273/0x3c0
[50529.149001] ? lock_release+0x134/0x270
[50529.149206] ? __pfx_wake_bit_function+0x10/0x10
[50529.149446] evict+0xcc/0x1d0
[50529.149622] inode_lru_isolate+0x14d/0x1e0
[50529.149847] __list_lru_walk_one+0xbe/0x1c0
[50529.150083] ? __pfx_inode_lru_isolate+0x10/0x10
[50529.150313] ? __pfx_inode_lru_isolate+0x10/0x10
[50529.150555] list_lru_walk_one+0x58/0x80
[50529.150760] prune_icache_sb+0x39/0x60
[50529.150957] super_cache_scan+0x161/0x1f0
[50529.151159] do_shrink_slab+0x163/0x340
[50529.151364] ? lock_is_held_type+0xe2/0x140
[50529.151584] shrink_slab+0x1d7/0x2a0
[50529.151766] shrink_node+0x2eb/0x7b0
[50529.151961] balance_pgdat+0x344/0x780
[50529.152154] kswapd+0x205/0x410
[50529.152332] ? __pfx_autoremove_wake_function+0x10/0x10
[50529.152606] ? __pfx_kswapd+0x10/0x10
[50529.152806] kthread+0xfc/0x130
[50529.152962] ? __pfx_kthread+0x10/0x10
[50529.153174] ret_from_fork+0x29/0x50
[50529.153349]
[50962.299840] BTRFS warning (device dm-9): failed to trim 3 block group(s), last error -512
[50967.540837] BTRFS: device fsid e40f0525-465a-480c-b87d-8b25f355e990 devid 1 transid 209 /dev/mapper/vg0-lv9 scanned by mount (3819622)
[50967.541763] BTRFS info (device dm-9): using crc32c (crc32c-intel) checksum algorithm
[50967.542077] BTRFS info (device dm-9): turning on sync discard
[50967.542300] BTRFS info (device dm-9): using free space tree