[51748.522747] run fstests generic/251 at 2023-09-04 11:16:06
[51748.930782] BTRFS: device fsid ec3e1159-917e-46d6-82d2-6d36aac552b0 devid 1 transid 2647065 /dev/mapper/vg0-lv0 scanned by mount (3764837)
[51748.931667] BTRFS info (device dm-0): using crc32c (crc32c-intel) checksum algorithm
[51748.931674] BTRFS info (device dm-0): using free space tree
[51748.935785] BTRFS info (device dm-0): auto enabling async discard
[51749.117939] BTRFS: device fsid 9a69b567-df43-4c6a-bdcb-9a2d2d10a47e devid 1 transid 6 /dev/mapper/vg0-lv9 scanned by mkfs.btrfs (3764885)
[51749.142033] BTRFS info (device dm-9): using crc32c (crc32c-intel) checksum algorithm
[51749.142042] BTRFS info (device dm-9): turning on sync discard
[51749.142045] BTRFS info (device dm-9): enabling free space tree
[51749.142046] BTRFS info (device dm-9): using free space tree
[51749.151435] BTRFS info (device dm-9): creating free space tree
[51749.152626] BTRFS info (device dm-9): setting compat-ro feature flag for FREE_SPACE_TREE (0x1)
[51749.152630] BTRFS info (device dm-9): setting compat-ro feature flag for FREE_SPACE_TREE_VALID (0x2)
[51749.163096] BTRFS info (device dm-9): cleaning free space cache v1
[51749.170839] BTRFS info (device dm-9): checking UUID tree
[52560.721390] ======================================================
[52560.721606] WARNING: possible circular locking dependency detected
[52560.721897] 6.5.0-rc7+ #1291 Not tainted
[52560.722040] ------------------------------------------------------
[52560.722255] kswapd0/47 is trying to acquire lock:
[52560.722422] ffff9aaf0679e388 (btrfs_trans_num_writers){++++}-{0:0}, at: join_transaction+0x1af/0x590
[52560.724985]
but task is already holding lock:
[52560.725319] ffff9aaf12fa1600 (sb_internal#2){++++}-{0:0}, at: btrfs_commit_inode_delayed_inode+0x5f/0x120
[52560.726052]
which lock already depends on the new lock.
[52560.726539]
the existing dependency chain (in reverse order) is:
[52560.726968]
-> #3 (sb_internal#2){++++}-{0:0}:
[52560.727326] start_transaction+0x3f9/0x740
[52560.727591] btrfs_commit_inode_delayed_inode+0x5f/0x120
[52560.727943] btrfs_evict_inode+0x273/0x3c0
[52560.728465] evict+0xcc/0x1d0
[52560.728830] inode_lru_isolate+0x14d/0x1e0
[52560.729092] __list_lru_walk_one+0xbe/0x1c0
[52560.729558] list_lru_walk_one+0x58/0x80
[52560.729787] prune_icache_sb+0x39/0x60
[52560.729995] super_cache_scan+0x161/0x1f0
[52560.730373] do_shrink_slab+0x163/0x340
[52560.730704] shrink_slab+0x1d7/0x2a0
[52560.730888] shrink_node+0x2eb/0x7b0
[52560.731086] balance_pgdat+0x344/0x780
[52560.731267] kswapd+0x205/0x410
[52560.731451] kthread+0xfc/0x130
[52560.731612] ret_from_fork+0x2d/0x50
[52560.731799] ret_from_fork_asm+0x1b/0x30
[52560.732263]
-> #2 (fs_reclaim){+.+.}-{0:0}:
[52560.732512] fs_reclaim_acquire+0xa5/0xe0
[52560.732894] kmem_cache_alloc_lru+0x4e/0x570
[52560.733420] btrfs_alloc_inode+0x2d/0x250
[52560.733613] alloc_inode+0x1a/0xc0
[52560.733801] iget5_locked+0xba/0x110
[52560.733987] btrfs_iget+0x43/0xe0
[52560.734155] create_reloc_inode+0x19d/0x370
[52560.734350] btrfs_relocate_block_group+0x1b7/0x410
[52560.734592] btrfs_relocate_chunk+0x4c/0x1b0
[52560.734815] btrfs_balance+0x8e7/0x11d0
[52560.734998] btrfs_ioctl+0x1d3d/0x2900
[52560.735181] __x64_sys_ioctl+0x8b/0xc0
[52560.735377] do_syscall_64+0x38/0x90
[52560.735780] entry_SYSCALL_64_after_hwframe+0x6e/0xd8
[52560.736177]
-> #1 (btrfs_trans_num_extwriters){++++}-{0:0}:
[52560.736477] join_transaction+0xb4/0x590
[52560.736667] start_transaction+0x187/0x740
[52560.736885] btrfs_uuid_scan_kthread+0x2bc/0x3d0
[52560.737089] kthread+0xfc/0x130
[52560.737250] ret_from_fork+0x2d/0x50
[52560.737425] ret_from_fork_asm+0x1b/0x30
[52560.737629]
-> #0 (btrfs_trans_num_writers){++++}-{0:0}:
[52560.737902] __lock_acquire+0x1415/0x2190
[52560.738108] lock_acquire+0xc7/0x2b0
[52560.738284] join_transaction+0x1de/0x590
[52560.738473] start_transaction+0x187/0x740
[52560.738677] btrfs_commit_inode_delayed_inode+0x5f/0x120
[52560.738950] btrfs_evict_inode+0x273/0x3c0
[52560.739219] evict+0xcc/0x1d0
[52560.739433] inode_lru_isolate+0x14d/0x1e0
[52560.739708] __list_lru_walk_one+0xbe/0x1c0
[52560.739975] list_lru_walk_one+0x58/0x80
[52560.740241] prune_icache_sb+0x39/0x60
[52560.740515] super_cache_scan+0x161/0x1f0
[52560.740791] do_shrink_slab+0x163/0x340
[52560.741057] shrink_slab+0x1d7/0x2a0
[52560.741303] shrink_node+0x2eb/0x7b0
[52560.741555] balance_pgdat+0x344/0x780
[52560.741826] kswapd+0x205/0x410
[52560.742052] kthread+0xfc/0x130
[52560.742288] ret_from_fork+0x2d/0x50
[52560.742553] ret_from_fork_asm+0x1b/0x30
[52560.742822]
other info that might help us debug this:
[52560.743298] Chain exists of:
btrfs_trans_num_writers --> fs_reclaim --> sb_internal#2
[52560.743924] Possible unsafe locking scenario:
[52560.744288] CPU0 CPU1
[52560.744569] ---- ----
[52560.744832] rlock(sb_internal#2);
[52560.745053] lock(fs_reclaim);
[52560.745402] lock(sb_internal#2);
[52560.745766] rlock(btrfs_trans_num_writers);
[52560.746034]
*** DEADLOCK ***
[52560.746393] 4 locks held by kswapd0/47:
[52560.746631] #0: ffffffffaae62280 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x492/0x780
[52560.747123] #1: ffffffffaae507d0 (shrinker_rwsem){++++}-{3:3}, at: shrink_slab+0x113/0x2a0
[52560.747608] #2: ffff9aaf12fa10e0 (&type->s_umount_key#45){++++}-{3:3}, at: super_cache_scan+0x38/0x1f0
[52560.748159] #3: ffff9aaf12fa1600 (sb_internal#2){++++}-{0:0}, at: btrfs_commit_inode_delayed_inode+0x5f/0x120
[52560.748759]
stack backtrace:
[52560.749024] CPU: 1 PID: 47 Comm: kswapd0 Not tainted 6.5.0-rc7+ #1291
[52560.749410] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014
[52560.749923] Call Trace:
[52560.750082]
[52560.750226] dump_stack_lvl+0x58/0x90
[52560.750629] check_noncircular+0x101/0x110
[52560.750869] __lock_acquire+0x1415/0x2190
[52560.751133] lock_acquire+0xc7/0x2b0
[52560.751361] ? join_transaction+0x1af/0x590
[52560.751620] ? lock_release+0x134/0x270
[52560.751863] join_transaction+0x1de/0x590
[52560.752109] ? join_transaction+0x1af/0x590
[52560.752364] start_transaction+0x187/0x740
[52560.752612] btrfs_commit_inode_delayed_inode+0x5f/0x120
[52560.752912] btrfs_evict_inode+0x273/0x3c0
[52560.753158] ? lock_release+0x134/0x270
[52560.753401] ? __pfx_wake_bit_function+0x10/0x10
[52560.753686] evict+0xcc/0x1d0
[52560.753867] inode_lru_isolate+0x14d/0x1e0
[52560.754110] __list_lru_walk_one+0xbe/0x1c0
[52560.754368] ? __pfx_inode_lru_isolate+0x10/0x10
[52560.754640] ? __pfx_inode_lru_isolate+0x10/0x10
[52560.754909] list_lru_walk_one+0x58/0x80
[52560.755154] prune_icache_sb+0x39/0x60
[52560.755374] super_cache_scan+0x161/0x1f0
[52560.755608] do_shrink_slab+0x163/0x340
[52560.755835] ? lock_is_held_type+0xe2/0x140
[52560.756095] shrink_slab+0x1d7/0x2a0
[52560.756329] shrink_node+0x2eb/0x7b0
[52560.756537] balance_pgdat+0x344/0x780
[52560.756785] kswapd+0x205/0x410
[52560.756977] ? __pfx_autoremove_wake_function+0x10/0x10
[52560.757289] ? __pfx_kswapd+0x10/0x10
[52560.757488] kthread+0xfc/0x130
[52560.757673] ? __pfx_kthread+0x10/0x10
[52560.757889] ret_from_fork+0x2d/0x50
[52560.758113] ? __pfx_kthread+0x10/0x10
[52560.758318] ret_from_fork_asm+0x1b/0x30
[52560.758558]
[52664.687122] BTRFS warning (device dm-9): failed to trim 10 block group(s), last error -512
[52668.241133] BTRFS: device fsid 9a69b567-df43-4c6a-bdcb-9a2d2d10a47e devid 1 transid 391 /dev/mapper/vg0-lv9 scanned by mount (3775556)
[52668.242531] BTRFS info (device dm-9): using crc32c (crc32c-intel) checksum algorithm
[52668.242840] BTRFS info (device dm-9): turning on sync discard
[52668.243047] BTRFS info (device dm-9): using free space tree