[20458.364462] run fstests btrfs/057 at 2023-08-30 02:34:48
[20458.882400] BTRFS: device fsid ec3e1159-917e-46d6-82d2-6d36aac552b0 devid 1 transid 2603110 /dev/mapper/vg0-lv0 scanned by mount (2890470)
[20458.884090] BTRFS info (device dm-0): using crc32c (crc32c-intel) checksum algorithm
[20458.884099] BTRFS info (device dm-0): using free space tree
[20458.888168] BTRFS info (device dm-0): auto enabling async discard
[20459.094315] BTRFS: device fsid f4315eff-eca9-4438-9416-3db8228d203f devid 1 transid 6 /dev/mapper/vg0-lv9 scanned by mkfs.btrfs (2890521)
[20459.102630] BTRFS info (device dm-9): using crc32c (crc32c-intel) checksum algorithm
[20459.102639] BTRFS info (device dm-9): setting incompat feature flag for COMPRESS_ZSTD (0x10)
[20459.102642] BTRFS info (device dm-9): use zstd compression, level 3
[20459.102645] BTRFS info (device dm-9): turning on async discard
[20459.102647] BTRFS info (device dm-9): disk space caching is enabled
[20459.107493] BTRFS info (device dm-9): checking UUID tree
[20459.112121] BTRFS info: devid 1 device path /dev/mapper/vg0-lv9 changed to /dev/dm-9 scanned by systemd-udevd (2886432)
[20459.113058] BTRFS info: devid 1 device path /dev/dm-9 changed to /dev/mapper/vg0-lv9 scanned by systemd-udevd (2886432)

[20462.690755] ======================================================
[20462.691062] WARNING: possible circular locking dependency detected
[20462.691366] 6.5.0-rc7+ #1286 Not tainted
[20462.691562] ------------------------------------------------------
[20462.691863] fsstress/2890558 is trying to acquire lock:
[20462.692145] ffff9a65ad2a0be0 (&fs_info->subvol_sem){++++}-{3:3}, at: btrfs_rename+0x629/0xc40
[20462.692621] 
               but task is already holding lock:
[20462.692907] ffff9a6588b30e60 (&sb->s_type->i_mutex_key#15/4){+.+.}-{3:3}, at: vfs_rename+0x19c/0xa30
[20462.693357] 
               which lock already depends on the new lock.

[20462.693744] 
               the existing dependency chain (in reverse order) is:
[20462.694105] 
               -> #3 (&sb->s_type->i_mutex_key#15/4){+.+.}-{3:3}:
[20462.694459]        down_write_nested+0x41/0xe0
[20462.694683]        btrfs_remap_file_range+0x5b/0x4d0
[20462.694929]        vfs_dedupe_file_range_one+0x16b/0x1e0
[20462.695153]        vfs_dedupe_file_range+0x168/0x200
[20462.695330]        do_vfs_ioctl+0x4d9/0x9b0
[20462.695478]        __x64_sys_ioctl+0x6a/0xc0
[20462.695633]        do_syscall_64+0x38/0x90
[20462.695791]        entry_SYSCALL_64_after_hwframe+0x6e/0xd8
[20462.695995] 
               -> #2 (&sb->s_type->i_mutex_key#15){++++}-{3:3}:
[20462.696246]        down_write+0x3b/0xd0
[20462.696386]        btrfs_inode_lock+0x3c/0x70
[20462.696542]        prealloc_file_extent_cluster+0x9f/0x320
[20462.696743]        relocate_file_extent_cluster+0x8d/0x960
[20462.696935]        relocate_data_extent+0x66/0xe0
[20462.697108]        relocate_block_group+0x463/0x550
[20462.697281]        btrfs_relocate_block_group+0x292/0x410
[20462.697472]        btrfs_relocate_chunk+0x4c/0x1b0
[20462.697642]        btrfs_balance+0x8e7/0x11d0
[20462.697804]        btrfs_ioctl+0x1d3d/0x2900
[20462.697964]        __x64_sys_ioctl+0x8b/0xc0
[20462.698117]        do_syscall_64+0x38/0x90
[20462.698265]        entry_SYSCALL_64_after_hwframe+0x6e/0xd8
[20462.698459] 
               -> #1 (&fs_info->cleaner_mutex){+.+.}-{3:3}:
[20462.698697]        __mutex_lock+0x75/0xcd0
[20462.698848]        btrfs_quota_disable+0x40/0x430
[20462.699084]        btrfs_ioctl+0x19dc/0x2900
[20462.699299]        __x64_sys_ioctl+0x8b/0xc0
[20462.699515]        do_syscall_64+0x38/0x90
[20462.699719]        entry_SYSCALL_64_after_hwframe+0x6e/0xd8
[20462.699997] 
               -> #0 (&fs_info->subvol_sem){++++}-{3:3}:
[20462.700311]        __lock_acquire+0x1415/0x2190
[20462.700477]        lock_acquire+0xc7/0x2b0
[20462.700623]        down_read+0x3e/0x180
[20462.700770]        btrfs_rename+0x629/0xc40
[20462.700922]        btrfs_rename2+0x2e/0x70
[20462.701074]        vfs_rename+0x443/0xa30
[20462.701220]        do_renameat2+0x34c/0x530
[20462.701370]        __x64_sys_rename+0x40/0x50
[20462.701528]        do_syscall_64+0x38/0x90
[20462.701674]        entry_SYSCALL_64_after_hwframe+0x6e/0xd8
[20462.701874] 
               other info that might help us debug this:

[20462.702153] Chain exists of:
                 &fs_info->subvol_sem --> &sb->s_type->i_mutex_key#15 --> &sb->s_type->i_mutex_key#15/4

[20462.702609]  Possible unsafe locking scenario:

[20462.702821]        CPU0                    CPU1
[20462.702987]        ----                    ----
[20462.703148]   lock(&sb->s_type->i_mutex_key#15/4);
[20462.703318]                                lock(&sb->s_type->i_mutex_key#15);
[20462.703564]                                lock(&sb->s_type->i_mutex_key#15/4);
[20462.703823]   rlock(&fs_info->subvol_sem);
[20462.703975] 
                *** DEADLOCK ***

[20462.704180] 4 locks held by fsstress/2890558:
[20462.704336]  #0: ffff9a6584408410 (sb_writers#12){++++}-{0:0}, at: do_renameat2+0x185/0x530
[20462.704626]  #1: ffff9a6588b36f50 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: do_renameat2+0x458/0x530
[20462.704961]  #2: ffff9a6588b30590 (&type->i_mutex_dir_key#6){++++}-{3:3}, at: lock_two_inodes+0x82/0xb0
[20462.705287]  #3: ffff9a6588b30e60 (&sb->s_type->i_mutex_key#15/4){+.+.}-{3:3}, at: vfs_rename+0x19c/0xa30
[20462.705615] 
               stack backtrace:
[20462.705780] CPU: 1 PID: 2890558 Comm: fsstress Not tainted 6.5.0-rc7+ #1286
[20462.706024] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014
[20462.706317] Call Trace:
[20462.706409]  
[20462.706491]  dump_stack_lvl+0x58/0x90
[20462.706625]  check_noncircular+0x101/0x110
[20462.706783]  __lock_acquire+0x1415/0x2190
[20462.706928]  ? lock_release+0x134/0x270
[20462.707072]  lock_acquire+0xc7/0x2b0
[20462.707202]  ? btrfs_rename+0x629/0xc40
[20462.707341]  down_read+0x3e/0x180
[20462.707463]  ? btrfs_rename+0x629/0xc40
[20462.707600]  btrfs_rename+0x629/0xc40
[20462.707744]  btrfs_rename2+0x2e/0x70
[20462.707877]  vfs_rename+0x443/0xa30
[20462.708010]  ? d_splice_alias+0x111/0x4f0
[20462.708157]  do_renameat2+0x34c/0x530
[20462.708293]  __x64_sys_rename+0x40/0x50
[20462.708431]  do_syscall_64+0x38/0x90
[20462.708561]  entry_SYSCALL_64_after_hwframe+0x6e/0xd8
[20462.708745] RIP: 0033:0x7f47b5b9fdbb
[20462.708881] Code: e8 5a a3 09 00 85 c0 0f 95 c0 0f b6 c0 f7 d8 5d c3 66 0f 1f 44 00 00 b8 ff ff ff ff 5d c3 90 f3 0f 1e fa b8 52 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 8b 15 89 a0 16 00 f7 d8
[20462.709512] RSP: 002b:00007ffec31fdcd8 EFLAGS: 00000206 ORIG_RAX: 0000000000000052
[20462.709777] RAX: ffffffffffffffda RBX: 00007ffec31fdf90 RCX: 00007f47b5b9fdbb
[20462.710028] RDX: 0000000000000000 RSI: 0000000001f8a430 RDI: 0000000001f8a410
[20462.710273] RBP: 00007ffec31fdfa0 R08: 0000000000000001 R09: 00007ffec31fdbb7
[20462.710521] R10: 00007f47b5d5e8c0 R11: 0000000000000206 R12: 000000000000001d
[20462.710814] R13: 0000000000000000 R14: 00007ffec31fdf74 R15: 00007ffec31fdfa0
[20462.711071]  
[20466.074807] BTRFS warning (device dm-9): qgroup rescan is already in progress
[20466.113866] BTRFS info (device dm-9): qgroup scan completed (inconsistency flag cleared)
[20466.601140] BTRFS: device fsid f4315eff-eca9-4438-9416-3db8228d203f devid 1 transid 199 /dev/mapper/vg0-lv9 scanned by mount (2890584)
[20466.602359] BTRFS info (device dm-9): using crc32c (crc32c-intel) checksum algorithm
[20466.602659] BTRFS info (device dm-9): use zstd compression, level 3
[20466.602891] BTRFS info (device dm-9): turning on async discard
[20466.603096] BTRFS info (device dm-9): disk space caching is enabled