[ 1472.285883] run fstests btrfs/020 at 2021-09-07 21:15:41
[ 1472.732255] loop0: detected capacity change from 0 to 524288
[ 1472.742525] loop1: detected capacity change from 0 to 524288
[ 1472.756611] loop2: detected capacity change from 0 to 524288
[ 1473.086530] BTRFS: device fsid fc75d50c-a1f7-497c-8a50-38559cf3843c devid 1 transid 5 /dev/loop0 scanned by systemd-udevd (225305)
[ 1473.094725] BTRFS: device fsid fc75d50c-a1f7-497c-8a50-38559cf3843c devid 2 transid 5 /dev/loop1 scanned by mkfs.btrfs (226498)
[ 1473.127869] BTRFS info (device loop0): flagging fs with big metadata feature
[ 1473.127874] BTRFS info (device loop0): disk space caching is enabled
[ 1473.127876] BTRFS info (device loop0): has skinny extents
[ 1473.144466] BTRFS info (device loop0): enabling ssd optimizations
[ 1473.282742] ======================================================
[ 1473.283106] WARNING: possible circular locking dependency detected
[ 1473.283474] 5.14.0-rc7+ #381 Not tainted
[ 1473.283709] ------------------------------------------------------
[ 1473.284070] losetup/226527 is trying to acquire lock:
[ 1473.284376] ffff890cc4c16938 ((wq_completion)loop0){+.+.}-{0:0}, at: flush_workqueue+0x67/0x5e0
[ 1473.284890]
but task is already holding lock:
[ 1473.285244] ffff890cc33d2c68 (&lo->lo_mutex){+.+.}-{3:3}, at: __loop_clr_fd+0x5b/0x670
[ 1473.285710]
which lock already depends on the new lock.
[ 1473.286194]
the existing dependency chain (in reverse order) is:
[ 1473.286628]
-> #5 (&lo->lo_mutex){+.+.}-{3:3}:
[ 1473.286981] __mutex_lock+0x7d/0x750
[ 1473.287229] lo_open+0x28/0x60
[ 1473.287445] blkdev_get_whole+0x25/0xf0
[ 1473.287705] blkdev_get_by_dev.part.0+0x168/0x3c0
[ 1473.288016] blkdev_open+0xd2/0xe0
[ 1473.288259] do_dentry_open+0x161/0x390
[ 1473.288518] path_openat+0x3cc/0xa20
[ 1473.288762] do_filp_open+0x96/0x120
[ 1473.289009] do_sys_openat2+0x7b/0x130
[ 1473.289271] __x64_sys_openat+0x46/0x70
[ 1473.289530] do_syscall_64+0x38/0x90
[ 1473.289776] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 1473.290107]
-> #4 (&disk->open_mutex){+.+.}-{3:3}:
[ 1473.290483] __mutex_lock+0x7d/0x750
[ 1473.290729] blkdev_get_by_dev.part.0+0xd1/0x3c0
[ 1473.291033] blkdev_get_by_path+0x98/0xa0
[ 1473.291306] btrfs_scan_one_device+0x39/0x1c0
[ 1473.291596] btrfs_control_ioctl+0xac/0x170
[ 1473.291877] __x64_sys_ioctl+0x80/0xb0
[ 1473.292137] do_syscall_64+0x38/0x90
[ 1473.292384] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 1473.292714]
-> #3 (uuid_mutex){+.+.}-{3:3}:
[ 1473.293091] __mutex_lock+0x7d/0x750
[ 1473.293347] btrfs_rm_device+0x44/0x6a0
[ 1473.293607] btrfs_ioctl+0x2afc/0x3040
[ 1473.293861] __x64_sys_ioctl+0x80/0xb0
[ 1473.294114] do_syscall_64+0x38/0x90
[ 1473.294365] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 1473.294696]
-> #2 (sb_writers#12){.+.+}-{0:0}:
[ 1473.295042] lo_write_bvec+0xc2/0x240
[ 1473.295348] loop_process_work+0x238/0xd00
[ 1473.295621] process_one_work+0x26b/0x560
[ 1473.295890] worker_thread+0x55/0x3c0
[ 1473.296148] kthread+0x140/0x160
[ 1473.296372] ret_from_fork+0x1f/0x30
[ 1473.296616]
-> #1 ((work_completion)(&lo->rootcg_work)){+.+.}-{0:0}:
[ 1473.297072] process_one_work+0x245/0x560
[ 1473.297348] worker_thread+0x55/0x3c0
[ 1473.297598] kthread+0x140/0x160
[ 1473.297824] ret_from_fork+0x1f/0x30
[ 1473.298104]
-> #0 ((wq_completion)loop0){+.+.}-{0:0}:
[ 1473.298708] __lock_acquire+0x10ea/0x1d90
[ 1473.299006] lock_acquire+0xb5/0x2b0
[ 1473.299392] flush_workqueue+0x91/0x5e0
[ 1473.299667] drain_workqueue+0xa0/0x110
[ 1473.299955] destroy_workqueue+0x36/0x250
[ 1473.300234] __loop_clr_fd+0xb4/0x670
[ 1473.300484] block_ioctl+0x3f/0x50
[ 1473.300719] __x64_sys_ioctl+0x80/0xb0
[ 1473.300972] do_syscall_64+0x38/0x90
[ 1473.301229] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 1473.301559]
other info that might help us debug this:
[ 1473.302022] Chain exists of:
(wq_completion)loop0 --> &disk->open_mutex --> &lo->lo_mutex
[ 1473.302685] Possible unsafe locking scenario:
[ 1473.303032] CPU0 CPU1
[ 1473.303302] ---- ----
[ 1473.303569] lock(&lo->lo_mutex);
[ 1473.303773] lock(&disk->open_mutex);
[ 1473.304146] lock(&lo->lo_mutex);
[ 1473.304495] lock((wq_completion)loop0);
[ 1473.304734]
*** DEADLOCK ***
[ 1473.305081] 1 lock held by losetup/226527:
[ 1473.305335] #0: ffff890cc33d2c68 (&lo->lo_mutex){+.+.}-{3:3}, at: __loop_clr_fd+0x5b/0x670
[ 1473.305829]
stack backtrace:
[ 1473.306099] CPU: 1 PID: 226527 Comm: losetup Not tainted 5.14.0-rc7+ #381
[ 1473.306505] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014
[ 1473.307002] Call Trace:
[ 1473.307162] dump_stack_lvl+0x57/0x72
[ 1473.307384] check_noncircular+0xcf/0xf0
[ 1473.307624] __lock_acquire+0x10ea/0x1d90
[ 1473.307867] lock_acquire+0xb5/0x2b0
[ 1473.308084] ? flush_workqueue+0x67/0x5e0
[ 1473.308333] ? lockdep_init_map_type+0x47/0x220
[ 1473.308606] flush_workqueue+0x91/0x5e0
[ 1473.308835] ? flush_workqueue+0x67/0x5e0
[ 1473.309076] ? verify_cpu+0xf0/0x100
[ 1473.309302] drain_workqueue+0xa0/0x110
[ 1473.309533] destroy_workqueue+0x36/0x250
[ 1473.309776] __loop_clr_fd+0xb4/0x670
[ 1473.310001] ? blkdev_ioctl+0x8d/0x2a0
[ 1473.310246] block_ioctl+0x3f/0x50
[ 1473.310455] __x64_sys_ioctl+0x80/0xb0
[ 1473.310684] do_syscall_64+0x38/0x90
[ 1473.310902] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 1473.311206] RIP: 0033:0x7f43de64a4cb
[ 1473.311434] Code: 89 d8 49 8d 3c 1c 48 f7 d8 49 39 c4 72 b5 e8 1c ff ff ff 85 c0 78 ba 4c 89 e0 5b 5d 41 5c c3 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 7d b9 0c 00 f7 d8 64 89 01 48
[ 1473.312521] RSP: 002b:00007fff5a62c5a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[ 1473.312965] RAX: ffffffffffffffda RBX: 00007fff5a62c690 RCX: 00007f43de64a4cb
[ 1473.313391] RDX: 0000000000000000 RSI: 0000000000004c01 RDI: 0000000000000003
[ 1473.313806] RBP: 00007fff5a62c690 R08: 0000000000000000 R09: 0000000000000000
[ 1473.314231] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
[ 1473.314648] R13: 000055c95e5e879c R14: 0000000000000000 R15: 00000000ffffffff
[ 1473.422956] BTRFS info (device dm-0): flagging fs with big metadata feature
[ 1473.423435] BTRFS info (device dm-0): turning on async discard
[ 1473.423784] BTRFS info (device dm-0): using free space tree
[ 1473.424124] BTRFS info (device dm-0): has skinny extents