[ 9737.553151] run fstests generic/251 at 2023-08-19 23:35:00
[ 9737.987852] BTRFS: device fsid 442e5b9d-ccad-458f-8dc7-acd1904d321e devid 1 transid 1452224 /dev/mapper/vg0-lv0 scanned by mount (1549131)
[ 9737.989225] BTRFS info (device dm-0): using crc32c (crc32c-intel) checksum algorithm
[ 9737.989231] BTRFS info (device dm-0): using free space tree
[ 9737.994185] BTRFS info (device dm-0): auto enabling async discard
[ 9738.207843] BTRFS: device fsid d7c6f4b5-4dce-422e-9e7b-250929415074 devid 1 transid 6 /dev/mapper/vg0-lv7 scanned by mkfs.btrfs (1549179)
[ 9738.227036] BTRFS info (device dm-7): using crc32c (crc32c-intel) checksum algorithm
[ 9738.227045] BTRFS info (device dm-7): using free space tree
[ 9738.229605] BTRFS info (device dm-7): auto enabling async discard
[ 9738.229754] BTRFS info (device dm-7): checking UUID tree

[10058.182358] ======================================================
[10058.182578] WARNING: possible circular locking dependency detected
[10058.182790] 6.5.0-rc6+ #1276 Not tainted
[10058.182958] ------------------------------------------------------
[10058.183165] kswapd0/47 is trying to acquire lock:
[10058.183355] ffff9142c9326388 (btrfs_trans_num_writers){++++}-{0:0}, at: join_transaction+0x1af/0x590
[10058.183698] 
               but task is already holding lock:
[10058.183948] ffff9142c0377600 (sb_internal){++++}-{0:0}, at: btrfs_commit_inode_delayed_inode+0x5f/0x120
[10058.184259] 
               which lock already depends on the new lock.

[10058.184600] 
               the existing dependency chain (in reverse order) is:
[10058.184915] 
               -> #3 (sb_internal){++++}-{0:0}:
[10058.185180]        start_transaction+0x3f9/0x740
[10058.185357]        btrfs_commit_inode_delayed_inode+0x5f/0x120
[10058.185559]        btrfs_evict_inode+0x273/0x3c0
[10058.185740]        evict+0xcc/0x1d0
[10058.185899]        inode_lru_isolate+0x14d/0x1e0
[10058.186076]        __list_lru_walk_one+0xbe/0x1c0
[10058.186259]        list_lru_walk_one+0x58/0x80
[10058.186430]        prune_icache_sb+0x39/0x60
[10058.186604]        super_cache_scan+0x161/0x1f0
[10058.186802]        do_shrink_slab+0x163/0x340
[10058.186977]        shrink_slab+0x1d7/0x2a0
[10058.187158]        shrink_node+0x2eb/0x7b0
[10058.187343]        balance_pgdat+0x344/0x780
[10058.187530]        kswapd+0x205/0x410
[10058.187716]        kthread+0xfc/0x130
[10058.187888]        ret_from_fork+0x2d/0x50
[10058.188060]        ret_from_fork_asm+0x1b/0x30
[10058.188239] 
               -> #2 (fs_reclaim){+.+.}-{0:0}:
[10058.188477]        fs_reclaim_acquire+0xa5/0xe0
[10058.188655]        kmem_cache_alloc_lru+0x4e/0x570
[10058.188838]        btrfs_alloc_inode+0x2d/0x250
[10058.189044]        alloc_inode+0x1a/0xc0
[10058.189214]        iget5_locked+0xba/0x110
[10058.189391]        btrfs_iget+0x43/0xe0
[10058.189566]        create_reloc_inode+0x19d/0x370
[10058.189757]        btrfs_relocate_block_group+0x1b7/0x410
[10058.189954]        btrfs_relocate_chunk+0x4c/0x1b0
[10058.190167]        btrfs_balance+0x8e7/0x11d0
[10058.190343]        btrfs_ioctl+0x1d3d/0x2900
[10058.190512]        __x64_sys_ioctl+0x8b/0xc0
[10058.190692]        do_syscall_64+0x38/0x90
[10058.190864]        entry_SYSCALL_64_after_hwframe+0x73/0xdd
[10058.191057] 
               -> #1 (btrfs_trans_num_extwriters){++++}-{0:0}:
[10058.191345]        join_transaction+0xb4/0x590
[10058.191517]        start_transaction+0x187/0x740
[10058.191699]        btrfs_dirty_inode+0x40/0xd0
[10058.191870]        touch_atime+0x15b/0x280
[10058.192041]        iterate_dir+0x117/0x180
[10058.192207]        __x64_sys_getdents64+0x6a/0x120
[10058.192387]        do_syscall_64+0x38/0x90
[10058.192580]        entry_SYSCALL_64_after_hwframe+0x73/0xdd
[10058.192786] 
               -> #0 (btrfs_trans_num_writers){++++}-{0:0}:
[10058.193050]        __lock_acquire+0x1415/0x2190
[10058.193258]        lock_acquire+0xc7/0x2b0
[10058.193454]        join_transaction+0x1de/0x590
[10058.193650]        start_transaction+0x187/0x740
[10058.193835]        btrfs_commit_inode_delayed_inode+0x5f/0x120
[10058.194039]        btrfs_evict_inode+0x273/0x3c0
[10058.194236]        evict+0xcc/0x1d0
[10058.194407]        inode_lru_isolate+0x14d/0x1e0
[10058.194597]        __list_lru_walk_one+0xbe/0x1c0
[10058.194800]        list_lru_walk_one+0x58/0x80
[10058.195012]        prune_icache_sb+0x39/0x60
[10058.195184]        super_cache_scan+0x161/0x1f0
[10058.195376]        do_shrink_slab+0x163/0x340
[10058.195563]        shrink_slab+0x1d7/0x2a0
[10058.195742]        shrink_node+0x2eb/0x7b0
[10058.195913]        balance_pgdat+0x344/0x780
[10058.196084]        kswapd+0x205/0x410
[10058.196266]        kthread+0xfc/0x130
[10058.196445]        ret_from_fork+0x2d/0x50
[10058.196612]        ret_from_fork_asm+0x1b/0x30
[10058.196804] 
               other info that might help us debug this:

[10058.197144] Chain exists of:
                 btrfs_trans_num_writers --> fs_reclaim --> sb_internal

[10058.197552]  Possible unsafe locking scenario:

[10058.197825]        CPU0                    CPU1
[10058.198007]        ----                    ----
[10058.198180]   rlock(sb_internal);
[10058.198335]                                lock(fs_reclaim);
[10058.198541]                                lock(sb_internal);
[10058.198751]   rlock(btrfs_trans_num_writers);
[10058.198937] 
                *** DEADLOCK ***

[10058.199245] 4 locks held by kswapd0/47:
[10058.199409]  #0: ffffffff86e62280 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x492/0x780
[10058.199700]  #1: ffffffff86e507d0 (shrinker_rwsem){++++}-{3:3}, at: shrink_slab+0x113/0x2a0
[10058.200019]  #2: ffff9142c03770e0 (&type->s_umount_key#35){++++}-{3:3}, at: super_cache_scan+0x38/0x1f0
[10058.200351]  #3: ffff9142c0377600 (sb_internal){++++}-{0:0}, at: btrfs_commit_inode_delayed_inode+0x5f/0x120
[10058.200678] 
               stack backtrace:
[10058.200890] CPU: 0 PID: 47 Comm: kswapd0 Not tainted 6.5.0-rc6+ #1276
[10058.201121] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014
[10058.201433] Call Trace:
[10058.201596]  
[10058.201768]  dump_stack_lvl+0x58/0x90
[10058.201948]  check_noncircular+0x101/0x110
[10058.202141]  __lock_acquire+0x1415/0x2190
[10058.202341]  lock_acquire+0xc7/0x2b0
[10058.202530]  ? join_transaction+0x1af/0x590
[10058.203545]  ? lock_release+0x134/0x270
[10058.203754]  join_transaction+0x1de/0x590
[10058.203953]  ? join_transaction+0x1af/0x590
[10058.204125]  start_transaction+0x187/0x740
[10058.204295]  btrfs_commit_inode_delayed_inode+0x5f/0x120
[10058.204492]  btrfs_evict_inode+0x273/0x3c0
[10058.204661]  ? lock_release+0x134/0x270
[10058.204828]  ? __pfx_wake_bit_function+0x10/0x10
[10058.205008]  evict+0xcc/0x1d0
[10058.205156]  inode_lru_isolate+0x14d/0x1e0
[10058.205326]  __list_lru_walk_one+0xbe/0x1c0
[10058.205511]  ? __pfx_inode_lru_isolate+0x10/0x10
[10058.205700]  ? __pfx_inode_lru_isolate+0x10/0x10
[10058.205882]  list_lru_walk_one+0x58/0x80
[10058.206073]  prune_icache_sb+0x39/0x60
[10058.206276]  super_cache_scan+0x161/0x1f0
[10058.206451]  do_shrink_slab+0x163/0x340
[10058.206618]  ? lock_is_held_type+0xe2/0x140
[10058.206792]  shrink_slab+0x1d7/0x2a0
[10058.206962]  shrink_node+0x2eb/0x7b0
[10058.207148]  balance_pgdat+0x344/0x780
[10058.207316]  kswapd+0x205/0x410
[10058.207466]  ? __pfx_autoremove_wake_function+0x10/0x10
[10058.207659]  ? __pfx_kswapd+0x10/0x10
[10058.207826]  kthread+0xfc/0x130
[10058.207974]  ? __pfx_kthread+0x10/0x10
[10058.208135]  ret_from_fork+0x2d/0x50
[10058.208297]  ? __pfx_kthread+0x10/0x10
[10058.208456]  ret_from_fork_asm+0x1b/0x30
[10058.208622]  
[10468.597814] BTRFS: device fsid d7c6f4b5-4dce-422e-9e7b-250929415074 devid 1 transid 93 /dev/mapper/vg0-lv7 scanned by mount (1558395)
[10468.600142] BTRFS info (device dm-7): using crc32c (crc32c-intel) checksum algorithm
[10468.600555] BTRFS info (device dm-7): using free space tree
[10468.603866] BTRFS info (device dm-7): auto enabling async discard