[ 1512.720661] run fstests btrfs/020 at 2021-09-08 21:16:15
[ 1513.139236] loop0: detected capacity change from 0 to 524288
[ 1513.154747] loop1: detected capacity change from 0 to 524288
[ 1513.166535] loop2: detected capacity change from 0 to 524288
[ 1513.652641] BTRFS: device fsid babbd02d-4328-4e5e-bc4f-5715bf59a602 devid 1 transid 5 /dev/loop0 scanned by systemd-udevd (230201)
[ 1513.673050] BTRFS: device fsid babbd02d-4328-4e5e-bc4f-5715bf59a602 devid 2 transid 5 /dev/loop1 scanned by mkfs.btrfs (232131)
[ 1513.702036] BTRFS info (device loop0): flagging fs with big metadata feature
[ 1513.702041] BTRFS info (device loop0): disk space caching is enabled
[ 1513.702042] BTRFS info (device loop0): has skinny extents
[ 1513.710489] BTRFS info (device loop0): enabling ssd optimizations

[ 1513.859379] ======================================================
[ 1513.860025] WARNING: possible circular locking dependency detected
[ 1513.860534] 5.14.0-rc7+ #382 Not tainted
[ 1513.860930] ------------------------------------------------------
[ 1513.861469] losetup/232160 is trying to acquire lock:
[ 1513.861849] ffff8f2043e0a938 ((wq_completion)loop0){+.+.}-{0:0}, at: flush_workqueue+0x67/0x5e0
[ 1513.862601] 
               but task is already holding lock:
[ 1513.862958] ffff8f204337ec68 (&lo->lo_mutex){+.+.}-{3:3}, at: __loop_clr_fd+0x5b/0x670
[ 1513.863473] 
               which lock already depends on the new lock.

[ 1513.863985] 
               the existing dependency chain (in reverse order) is:
[ 1513.864444] 
               -> #5 (&lo->lo_mutex){+.+.}-{3:3}:
[ 1513.864812]        __mutex_lock+0x7d/0x750
[ 1513.865161]        lo_open+0x28/0x60
[ 1513.865465]        blkdev_get_whole+0x25/0xf0
[ 1513.865848]        blkdev_get_by_dev.part.0+0x168/0x3c0
[ 1513.866297]        blkdev_open+0xd2/0xe0
[ 1513.866670]        do_dentry_open+0x161/0x390
[ 1513.867076]        path_openat+0x3cc/0xa20
[ 1513.867412]        do_filp_open+0x96/0x120
[ 1513.867759]        do_sys_openat2+0x7b/0x130
[ 1513.868119]        __x64_sys_openat+0x46/0x70
[ 1513.868478]        do_syscall_64+0x38/0x90
[ 1513.868793]        entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 1513.869250] 
               -> #4 (&disk->open_mutex){+.+.}-{3:3}:
[ 1513.869831]        __mutex_lock+0x7d/0x750
[ 1513.870175]        blkdev_get_by_dev.part.0+0xd1/0x3c0
[ 1513.870600]        blkdev_get_by_path+0x98/0xa0
[ 1513.870990]        btrfs_scan_one_device+0x39/0x1c0
[ 1513.871389]        btrfs_control_ioctl+0xac/0x170
[ 1513.871799]        __x64_sys_ioctl+0x80/0xb0
[ 1513.872062]        do_syscall_64+0x38/0x90
[ 1513.872342]        entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 1513.872705] 
               -> #3 (uuid_mutex){+.+.}-{3:3}:
[ 1513.873041]        __mutex_lock+0x7d/0x750
[ 1513.873296]        btrfs_rm_device+0x44/0x6a0
[ 1513.873557]        btrfs_ioctl+0x2afc/0x3040
[ 1513.873830]        __x64_sys_ioctl+0x80/0xb0
[ 1513.874088]        do_syscall_64+0x38/0x90
[ 1513.874421]        entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 1513.874893] 
               -> #2 (sb_writers#12){.+.+}-{0:0}:
[ 1513.875396]        lo_write_bvec+0xc2/0x240
[ 1513.875768]        loop_process_work+0x238/0xd00
[ 1513.876206]        process_one_work+0x26b/0x560
[ 1513.876596]        worker_thread+0x55/0x3c0
[ 1513.877001]        kthread+0x140/0x160
[ 1513.877327]        ret_from_fork+0x1f/0x30
[ 1513.877682] 
               -> #1 ((work_completion)(&lo->rootcg_work)){+.+.}-{0:0}:
[ 1513.878361]        process_one_work+0x245/0x560
[ 1513.878842]        worker_thread+0x55/0x3c0
[ 1513.879197]        kthread+0x140/0x160
[ 1513.879518]        ret_from_fork+0x1f/0x30
[ 1513.879954] 
               -> #0 ((wq_completion)loop0){+.+.}-{0:0}:
[ 1513.880523]        __lock_acquire+0x10ea/0x1d90
[ 1513.880912]        lock_acquire+0xb5/0x2b0
[ 1513.881261]        flush_workqueue+0x91/0x5e0
[ 1513.881633]        drain_workqueue+0xa0/0x110
[ 1513.882008]        destroy_workqueue+0x36/0x250
[ 1513.882383]        __loop_clr_fd+0xb4/0x670
[ 1513.882729]        block_ioctl+0x3f/0x50
[ 1513.883059]        __x64_sys_ioctl+0x80/0xb0
[ 1513.883419]        do_syscall_64+0x38/0x90
[ 1513.883772]        entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 1513.884239] 
               other info that might help us debug this:

[ 1513.884897] Chain exists of:
                 (wq_completion)loop0 --> &disk->open_mutex --> &lo->lo_mutex

[ 1513.885738]  Possible unsafe locking scenario:

[ 1513.886224]        CPU0                    CPU1
[ 1513.886612]        ----                    ----
[ 1513.886880]   lock(&lo->lo_mutex);
[ 1513.887126]                                lock(&disk->open_mutex);
[ 1513.887526]                                lock(&lo->lo_mutex);
[ 1513.887881]   lock((wq_completion)loop0);
[ 1513.888121] 
                *** DEADLOCK ***

[ 1513.888475] 1 lock held by losetup/232160:
[ 1513.888723]  #0: ffff8f204337ec68 (&lo->lo_mutex){+.+.}-{3:3}, at: __loop_clr_fd+0x5b/0x670
[ 1513.889243] 
               stack backtrace:
[ 1513.889512] CPU: 0 PID: 232160 Comm: losetup Not tainted 5.14.0-rc7+ #382
[ 1513.889972] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014
[ 1513.890479] Call Trace:
[ 1513.890642]  dump_stack_lvl+0x57/0x72
[ 1513.890865]  check_noncircular+0xcf/0xf0
[ 1513.891126]  __lock_acquire+0x10ea/0x1d90
[ 1513.891458]  lock_acquire+0xb5/0x2b0
[ 1513.891757]  ? flush_workqueue+0x67/0x5e0
[ 1513.892087]  ? lockdep_init_map_type+0x47/0x220
[ 1513.892457]  flush_workqueue+0x91/0x5e0
[ 1513.892777]  ? flush_workqueue+0x67/0x5e0
[ 1513.893085]  ? verify_cpu+0xf0/0x100
[ 1513.893368]  drain_workqueue+0xa0/0x110
[ 1513.893690]  destroy_workqueue+0x36/0x250
[ 1513.894021]  __loop_clr_fd+0xb4/0x670
[ 1513.894317]  ? blkdev_ioctl+0x8d/0x2a0
[ 1513.894633]  block_ioctl+0x3f/0x50
[ 1513.894904]  __x64_sys_ioctl+0x80/0xb0
[ 1513.895214]  do_syscall_64+0x38/0x90
[ 1513.895516]  entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 1513.895949] RIP: 0033:0x7f2fe46004cb
[ 1513.896256] 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
[ 1513.897763] RSP: 002b:00007ffebd1aa018 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[ 1513.898337] RAX: ffffffffffffffda RBX: 00007ffebd1aa100 RCX: 00007f2fe46004cb
[ 1513.898922] RDX: 0000000000000000 RSI: 0000000000004c01 RDI: 0000000000000003
[ 1513.899445] RBP: 00007ffebd1aa100 R08: 0000000000000000 R09: 0000000000000000
[ 1513.900056] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
[ 1513.900683] R13: 0000556b4700b79c R14: 0000000000000000 R15: 00000000ffffffff
[ 1514.001027] BTRFS info (device dm-0): flagging fs with big metadata feature
[ 1514.001467] BTRFS info (device dm-0): turning on async discard
[ 1514.001842] BTRFS info (device dm-0): using free space tree
[ 1514.002213] BTRFS info (device dm-0): has skinny extents