[47996.076692] run fstests generic/251 at 2023-08-28 10:14:26
[47996.483744] BTRFS: device fsid ec3e1159-917e-46d6-82d2-6d36aac552b0 devid 1 transid 2590977 /dev/mapper/vg0-lv0 scanned by mount (3824511)
[47996.484322] BTRFS info (device dm-0): using crc32c (crc32c-intel) checksum algorithm
[47996.484328] BTRFS info (device dm-0): using free space tree
[47996.487783] BTRFS info (device dm-0): auto enabling async discard
[47996.671019] BTRFS: device fsid b90876c9-6132-429a-b270-da845fa73759 devid 1 transid 6 /dev/mapper/vg0-lv9 scanned by mkfs.btrfs (3824559)
[47996.688592] BTRFS info (device dm-9): using crc32c (crc32c-intel) checksum algorithm
[47996.688600] BTRFS info (device dm-9): turning on sync discard
[47996.688603] BTRFS info (device dm-9): enabling free space tree
[47996.688605] BTRFS info (device dm-9): using free space tree
[47996.695210] BTRFS info (device dm-9): creating free space tree
[47996.696389] BTRFS info (device dm-9): setting compat-ro feature flag for FREE_SPACE_TREE (0x1)
[47996.696393] BTRFS info (device dm-9): setting compat-ro feature flag for FREE_SPACE_TREE_VALID (0x2)
[47996.704111] BTRFS info (device dm-9): cleaning free space cache v1
[47996.718089] BTRFS info (device dm-9): checking UUID tree

[49023.097573] ======================================================
[49023.097809] WARNING: possible circular locking dependency detected
[49023.098045] 6.5.0-rc7+ #1284 Not tainted
[49023.098200] ------------------------------------------------------
[49023.098435] kswapd0/47 is trying to acquire lock:
[49023.098621] ffff9b90f0b7a388 (btrfs_trans_num_writers){++++}-{0:0}, at: join_transaction+0x1af/0x590
[49023.101014] 
               but task is already holding lock:
[49023.101238] ffff9b90ee803600 (sb_internal#2){++++}-{0:0}, at: btrfs_commit_inode_delayed_inode+0x5f/0x120
[49023.101816] 
               which lock already depends on the new lock.

[49023.102118] 
               the existing dependency chain (in reverse order) is:
[49023.102398] 
               -> #3 (sb_internal#2){++++}-{0:0}:
[49023.102630]        start_transaction+0x3f9/0x740
[49023.102811]        btrfs_commit_inode_delayed_inode+0x5f/0x120
[49023.103038]        btrfs_evict_inode+0x273/0x3c0
[49023.103460]        evict+0xcc/0x1d0
[49023.103779]        inode_lru_isolate+0x14d/0x1e0
[49023.103959]        __list_lru_walk_one+0xbe/0x1c0
[49023.104342]        list_lru_walk_one+0x58/0x80
[49023.104522]        prune_icache_sb+0x39/0x60
[49023.104691]        super_cache_scan+0x161/0x1f0
[49023.105053]        do_shrink_slab+0x163/0x340
[49023.105388]        shrink_slab+0x1d7/0x2a0
[49023.105553]        shrink_node+0x2eb/0x7b0
[49023.105710]        balance_pgdat+0x344/0x780
[49023.105877]        kswapd+0x205/0x410
[49023.106022]        kthread+0xfc/0x130
[49023.106169]        ret_from_fork+0x2d/0x50
[49023.106328]        ret_from_fork_asm+0x1b/0x30
[49023.107169] 
               -> #2 (fs_reclaim){+.+.}-{0:0}:
[49023.107635]        fs_reclaim_acquire+0xa5/0xe0
[49023.107966]        kmem_cache_alloc_lru+0x4e/0x570
[49023.108458]        btrfs_alloc_inode+0x2d/0x250
[49023.108669]        alloc_inode+0x1a/0xc0
[49023.108852]        iget5_locked+0xba/0x110
[49023.109045]        btrfs_iget+0x43/0xe0
[49023.109210]        create_reloc_inode+0x19d/0x370
[49023.109405]        btrfs_relocate_block_group+0x1b7/0x410
[49023.109660]        btrfs_relocate_chunk+0x4c/0x1b0
[49023.109882]        btrfs_balance+0x8e7/0x11d0
[49023.110078]        btrfs_ioctl+0x1d3d/0x2900
[49023.110266]        __x64_sys_ioctl+0x8b/0xc0
[49023.110463]        do_syscall_64+0x38/0x90
[49023.110993]        entry_SYSCALL_64_after_hwframe+0x6e/0xd8
[49023.111520] 
               -> #1 (btrfs_trans_num_extwriters){++++}-{0:0}:
[49023.111855]        join_transaction+0xb4/0x590
[49023.112065]        start_transaction+0x187/0x740
[49023.112258]        btrfs_uuid_scan_kthread+0x2bc/0x3d0
[49023.112499]        kthread+0xfc/0x130
[49023.112663]        ret_from_fork+0x2d/0x50
[49023.112855]        ret_from_fork_asm+0x1b/0x30
[49023.113062] 
               -> #0 (btrfs_trans_num_writers){++++}-{0:0}:
[49023.113473]        __lock_acquire+0x1415/0x2190
[49023.113763]        lock_acquire+0xc7/0x2b0
[49023.113967]        join_transaction+0x1de/0x590
[49023.114177]        start_transaction+0x187/0x740
[49023.114374]        btrfs_commit_inode_delayed_inode+0x5f/0x120
[49023.114700]        btrfs_evict_inode+0x273/0x3c0
[49023.114990]        evict+0xcc/0x1d0
[49023.115193]        inode_lru_isolate+0x14d/0x1e0
[49023.115403]        __list_lru_walk_one+0xbe/0x1c0
[49023.115602]        list_lru_walk_one+0x58/0x80
[49023.115809]        prune_icache_sb+0x39/0x60
[49023.116030]        super_cache_scan+0x161/0x1f0
[49023.116311]        do_shrink_slab+0x163/0x340
[49023.116593]        shrink_slab+0x1d7/0x2a0
[49023.116848]        shrink_node+0x2eb/0x7b0
[49023.117105]        balance_pgdat+0x344/0x780
[49023.117385]        kswapd+0x205/0x410
[49023.117627]        kthread+0xfc/0x130
[49023.117868]        ret_from_fork+0x2d/0x50
[49023.118134]        ret_from_fork_asm+0x1b/0x30
[49023.118419] 
               other info that might help us debug this:

[49023.118893] Chain exists of:
                 btrfs_trans_num_writers --> fs_reclaim --> sb_internal#2

[49023.119465]  Possible unsafe locking scenario:

[49023.119692]        CPU0                    CPU1
[49023.119868]        ----                    ----
[49023.120042]   rlock(sb_internal#2);
[49023.120181]                                lock(fs_reclaim);
[49023.120399]                                lock(sb_internal#2);
[49023.120628]   rlock(btrfs_trans_num_writers);
[49023.120797] 
                *** DEADLOCK ***

[49023.121024] 4 locks held by kswapd0/47:
[49023.121173]  #0: ffffffffb5e62280 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x492/0x780
[49023.121512]  #1: ffffffffb5e507d0 (shrinker_rwsem){++++}-{3:3}, at: shrink_slab+0x113/0x2a0
[49023.121827]  #2: ffff9b90ee8030e0 (&type->s_umount_key#45){++++}-{3:3}, at: super_cache_scan+0x38/0x1f0
[49023.122408]  #3: ffff9b90ee803600 (sb_internal#2){++++}-{0:0}, at: btrfs_commit_inode_delayed_inode+0x5f/0x120
[49023.123032] 
               stack backtrace:
[49023.123302] CPU: 1 PID: 47 Comm: kswapd0 Not tainted 6.5.0-rc7+ #1284
[49023.123700] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014
[49023.124196] Call Trace:
[49023.124337]  
[49023.124482]  dump_stack_lvl+0x58/0x90
[49023.124975]  check_noncircular+0x101/0x110
[49023.125224]  __lock_acquire+0x1415/0x2190
[49023.125468]  lock_acquire+0xc7/0x2b0
[49023.125686]  ? join_transaction+0x1af/0x590
[49023.125940]  ? lock_release+0x134/0x270
[49023.126162]  join_transaction+0x1de/0x590
[49023.126389]  ? join_transaction+0x1af/0x590
[49023.126627]  start_transaction+0x187/0x740
[49023.126857]  btrfs_commit_inode_delayed_inode+0x5f/0x120
[49023.127153]  btrfs_evict_inode+0x273/0x3c0
[49023.127396]  ? lock_release+0x134/0x270
[49023.127607]  ? __pfx_wake_bit_function+0x10/0x10
[49023.127874]  evict+0xcc/0x1d0
[49023.128052]  inode_lru_isolate+0x14d/0x1e0
[49023.128271]  __list_lru_walk_one+0xbe/0x1c0
[49023.128504]  ? __pfx_inode_lru_isolate+0x10/0x10
[49023.128753]  ? __pfx_inode_lru_isolate+0x10/0x10
[49023.129016]  list_lru_walk_one+0x58/0x80
[49023.129226]  prune_icache_sb+0x39/0x60
[49023.129430]  super_cache_scan+0x161/0x1f0
[49023.129663]  do_shrink_slab+0x163/0x340
[49023.129884]  ? lock_is_held_type+0xe2/0x140
[49023.130112]  shrink_slab+0x1d7/0x2a0
[49023.130311]  shrink_node+0x2eb/0x7b0
[49023.130515]  balance_pgdat+0x344/0x780
[49023.130727]  kswapd+0x205/0x410
[49023.130913]  ? __pfx_autoremove_wake_function+0x10/0x10
[49023.131182]  ? __pfx_kswapd+0x10/0x10
[49023.131375]  kthread+0xfc/0x130
[49023.131551]  ? __pfx_kthread+0x10/0x10
[49023.131758]  ret_from_fork+0x2d/0x50
[49023.131956]  ? __pfx_kthread+0x10/0x10
[49023.132159]  ret_from_fork_asm+0x1b/0x30
[49023.132372]  
[49052.533169] BTRFS warning (device dm-9): failed to trim 5 block group(s), last error -512
[49056.131879] BTRFS: device fsid b90876c9-6132-429a-b270-da845fa73759 devid 1 transid 361 /dev/mapper/vg0-lv9 scanned by mount (3835431)
[49056.133299] BTRFS info (device dm-9): using crc32c (crc32c-intel) checksum algorithm
[49056.133606] BTRFS info (device dm-9): turning on sync discard
[49056.133816] BTRFS info (device dm-9): using free space tree