[ 9027.842581] run fstests generic/251 at 2023-08-15 23:23:06
[ 9028.241427] BTRFS: device fsid 442e5b9d-ccad-458f-8dc7-acd1904d321e devid 1 transid 1434607 /dev/mapper/vg0-lv0 scanned by mount (1550015)
[ 9028.242576] BTRFS info (device dm-0): using crc32c (crc32c-intel) checksum algorithm
[ 9028.242583] BTRFS info (device dm-0): using free space tree
[ 9028.247896] BTRFS info (device dm-0): auto enabling async discard
[ 9028.438922] BTRFS: device fsid af1db4cc-11fa-44a3-a4b4-7bb53f0351e4 devid 1 transid 6 /dev/mapper/vg0-lv7 scanned by mkfs.btrfs (1550063)
[ 9028.459256] BTRFS info (device dm-7): using crc32c (crc32c-intel) checksum algorithm
[ 9028.459265] BTRFS info (device dm-7): using free space tree
[ 9028.461998] BTRFS info (device dm-7): auto enabling async discard
[ 9028.462154] BTRFS info (device dm-7): checking UUID tree
[ 9490.738055] ======================================================
[ 9490.738269] WARNING: possible circular locking dependency detected
[ 9490.738446] 6.5.0-rc6+ #1272 Not tainted
[ 9490.738588] ------------------------------------------------------
[ 9490.738764] kswapd0/47 is trying to acquire lock:
[ 9490.738922] ffff98277cbda388 (btrfs_trans_num_writers){++++}-{0:0}, at: join_transaction+0x1af/0x590
[ 9490.739209]
but task is already holding lock:
[ 9490.739418] ffff982745a1b600 (sb_internal){++++}-{0:0}, at: btrfs_commit_inode_delayed_inode+0x5f/0x120
[ 9490.739696]
which lock already depends on the new lock.
[ 9490.739979]
the existing dependency chain (in reverse order) is:
[ 9490.740221]
-> #3 (sb_internal){++++}-{0:0}:
[ 9490.740431] start_transaction+0x3f9/0x740
[ 9490.740589] btrfs_commit_inode_delayed_inode+0x5f/0x120
[ 9490.740761] btrfs_evict_inode+0x273/0x3c0
[ 9490.740918] evict+0xcc/0x1d0
[ 9490.741057] inode_lru_isolate+0x14d/0x1e0
[ 9490.741219] __list_lru_walk_one+0xbe/0x1c0
[ 9490.741381] list_lru_walk_one+0x58/0x80
[ 9490.741532] prune_icache_sb+0x39/0x60
[ 9490.741679] super_cache_scan+0x161/0x1f0
[ 9490.741839] do_shrink_slab+0x163/0x340
[ 9490.741994] shrink_slab+0x1d7/0x2a0
[ 9490.742143] shrink_node+0x2eb/0x7b0
[ 9490.742287] balance_pgdat+0x344/0x780
[ 9490.742436] kswapd+0x205/0x410
[ 9490.742576] kthread+0xfc/0x130
[ 9490.742720] ret_from_fork+0x2d/0x50
[ 9490.742873] ret_from_fork_asm+0x1b/0x30
[ 9490.743029]
-> #2 (fs_reclaim){+.+.}-{0:0}:
[ 9490.743244] fs_reclaim_acquire+0xa5/0xe0
[ 9490.743404] kmem_cache_alloc_lru+0x4e/0x570
[ 9490.743563] btrfs_alloc_inode+0x2d/0x250
[ 9490.743716] alloc_inode+0x1a/0xc0
[ 9490.743858] iget5_locked+0xba/0x110
[ 9490.744005] btrfs_iget+0x43/0xe0
[ 9490.744804] create_reloc_inode+0x19d/0x370
[ 9490.744960] btrfs_relocate_block_group+0x1b7/0x410
[ 9490.745138] btrfs_relocate_chunk+0x4c/0x1b0
[ 9490.745303] btrfs_balance+0x8e7/0x11d0
[ 9490.745456] btrfs_ioctl+0x1d3d/0x2900
[ 9490.745602] __x64_sys_ioctl+0x8b/0xc0
[ 9490.745751] do_syscall_64+0x38/0x90
[ 9490.745906] entry_SYSCALL_64_after_hwframe+0x73/0xdd
[ 9490.746085]
-> #1 (btrfs_trans_num_extwriters){++++}-{0:0}:
[ 9490.746315] join_transaction+0xb4/0x590
[ 9490.746469] start_transaction+0x187/0x740
[ 9490.746626] btrfs_dirty_inode+0x40/0xd0
[ 9490.746776] touch_atime+0x15b/0x280
[ 9490.746920] step_into+0x2bf/0x6e0
[ 9490.747068] path_openat+0x139/0xa30
[ 9490.747217] do_filp_open+0x96/0x120
[ 9490.747362] do_sys_openat2+0x83/0xb0
[ 9490.747510] __x64_sys_openat+0x46/0x70
[ 9490.747662] do_syscall_64+0x38/0x90
[ 9490.747809] entry_SYSCALL_64_after_hwframe+0x73/0xdd
[ 9490.747977]
-> #0 (btrfs_trans_num_writers){++++}-{0:0}:
[ 9490.748207] __lock_acquire+0x1415/0x2190
[ 9490.748363] lock_acquire+0xc7/0x2b0
[ 9490.748508] join_transaction+0x1de/0x590
[ 9490.748664] start_transaction+0x187/0x740
[ 9490.748821] btrfs_commit_inode_delayed_inode+0x5f/0x120
[ 9490.748992] btrfs_evict_inode+0x273/0x3c0
[ 9490.749151] evict+0xcc/0x1d0
[ 9490.749286] inode_lru_isolate+0x14d/0x1e0
[ 9490.749442] __list_lru_walk_one+0xbe/0x1c0
[ 9490.749597] list_lru_walk_one+0x58/0x80
[ 9490.749748] prune_icache_sb+0x39/0x60
[ 9490.749895] super_cache_scan+0x161/0x1f0
[ 9490.750050] do_shrink_slab+0x163/0x340
[ 9490.750204] shrink_slab+0x1d7/0x2a0
[ 9490.750349] shrink_node+0x2eb/0x7b0
[ 9490.750497] balance_pgdat+0x344/0x780
[ 9490.750647] kswapd+0x205/0x410
[ 9490.750784] kthread+0xfc/0x130
[ 9490.750922] ret_from_fork+0x2d/0x50
[ 9490.751071] ret_from_fork_asm+0x1b/0x30
[ 9490.751230]
other info that might help us debug this:
[ 9490.751507] Chain exists of:
btrfs_trans_num_writers --> fs_reclaim --> sb_internal
[ 9490.751833] Possible unsafe locking scenario:
[ 9490.752039] CPU0 CPU1
[ 9490.752196] ---- ----
[ 9490.752345] rlock(sb_internal);
[ 9490.752477] lock(fs_reclaim);
[ 9490.752649] lock(sb_internal);
[ 9490.752823] rlock(btrfs_trans_num_writers);
[ 9490.752973]
*** DEADLOCK ***
[ 9490.753220] 4 locks held by kswapd0/47:
[ 9490.753360] #0: ffffffff8ae62280 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x492/0x780
[ 9490.753678] #1: ffffffff8ae507d0 (shrinker_rwsem){++++}-{3:3}, at: shrink_slab+0x113/0x2a0
[ 9490.753929] #2: ffff982745a1b0e0 (&type->s_umount_key#35){++++}-{3:3}, at: super_cache_scan+0x38/0x1f0
[ 9490.754223] #3: ffff982745a1b600 (sb_internal){++++}-{0:0}, at: btrfs_commit_inode_delayed_inode+0x5f/0x120
[ 9490.754498]
stack backtrace:
[ 9490.754684] CPU: 0 PID: 47 Comm: kswapd0 Not tainted 6.5.0-rc6+ #1272
[ 9490.754867] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014
[ 9490.755174] Call Trace:
[ 9490.755298]
[ 9490.755411] dump_stack_lvl+0x58/0x90
[ 9490.755575] check_noncircular+0x101/0x110
[ 9490.755724] __lock_acquire+0x1415/0x2190
[ 9490.755906] lock_acquire+0xc7/0x2b0
[ 9490.756122] ? join_transaction+0x1af/0x590
[ 9490.756297] ? lock_release+0x134/0x270
[ 9490.756488] join_transaction+0x1de/0x590
[ 9490.756655] ? join_transaction+0x1af/0x590
[ 9490.756845] start_transaction+0x187/0x740
[ 9490.757038] btrfs_commit_inode_delayed_inode+0x5f/0x120
[ 9490.757212] btrfs_evict_inode+0x273/0x3c0
[ 9490.757393] ? lock_release+0x134/0x270
[ 9490.757597] ? __pfx_wake_bit_function+0x10/0x10
[ 9490.757818] evict+0xcc/0x1d0
[ 9490.757990] inode_lru_isolate+0x14d/0x1e0
[ 9490.758177] __list_lru_walk_one+0xbe/0x1c0
[ 9490.758384] ? __pfx_inode_lru_isolate+0x10/0x10
[ 9490.758584] ? __pfx_inode_lru_isolate+0x10/0x10
[ 9490.758739] list_lru_walk_one+0x58/0x80
[ 9490.758901] prune_icache_sb+0x39/0x60
[ 9490.759046] super_cache_scan+0x161/0x1f0
[ 9490.759236] do_shrink_slab+0x163/0x340
[ 9490.759458] ? lock_is_held_type+0xe2/0x140
[ 9490.759624] shrink_slab+0x1d7/0x2a0
[ 9490.759767] shrink_node+0x2eb/0x7b0
[ 9490.759903] balance_pgdat+0x344/0x780
[ 9490.760049] kswapd+0x205/0x410
[ 9490.760189] ? __pfx_autoremove_wake_function+0x10/0x10
[ 9490.760352] ? __pfx_kswapd+0x10/0x10
[ 9490.760489] kthread+0xfc/0x130
[ 9490.760622] ? __pfx_kthread+0x10/0x10
[ 9490.760762] ret_from_fork+0x2d/0x50
[ 9490.760898] ? __pfx_kthread+0x10/0x10
[ 9490.761040] ret_from_fork_asm+0x1b/0x30
[ 9490.761196]
[ 9701.240819] BTRFS warning (device dm-7): failed to trim 9 block group(s), last error -512
[ 9706.515727] BTRFS: device fsid af1db4cc-11fa-44a3-a4b4-7bb53f0351e4 devid 1 transid 98 /dev/mapper/vg0-lv7 scanned by mount (1560112)
[ 9706.517088] BTRFS info (device dm-7): using crc32c (crc32c-intel) checksum algorithm
[ 9706.517343] BTRFS info (device dm-7): using free space tree
[ 9706.519977] BTRFS info (device dm-7): auto enabling async discard