loop3: detected capacity change from 0 to 1024
======================================================
WARNING: possible circular locking dependency detected
5.15.0-rc2-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.3/22450 is trying to acquire lock:
ffff888072d90230 (&mddev->open_mutex){+.+.}-{3:3}, at: md_open+0x227/0x320 drivers/md/md.c:7815

but task is already holding lock:
ffff88807e3f6918 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0xf6/0xb90 block/bdev.c:816

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&disk->open_mutex){+.+.}-{3:3}:
       lock_acquire+0x19f/0x4d0 kernel/locking/lockdep.c:5625
       __mutex_lock_common+0x1df/0x2550 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x1a/0x20 kernel/locking/mutex.c:743
       bd_register_pending_holders+0x32/0x370 block/holder.c:160
       device_add_disk+0x4df/0xe70 block/genhd.c:475
       add_disk include/linux/genhd.h:221 [inline]
       md_alloc+0x829/0xc70 drivers/md/md.c:5707
       blk_request_module+0x19d/0x1c0 block/genhd.c:637
       blkdev_get_no_open+0x37/0x180 block/bdev.c:739
       blkdev_get_by_dev+0x84/0xb90 block/bdev.c:803
       ext4_blkdev_get fs/ext4/super.c:1079 [inline]
       ext4_get_dev_journal fs/ext4/super.c:5185 [inline]
       ext4_load_journal fs/ext4/super.c:5296 [inline]
       ext4_fill_super+0x9d37/0xf160 fs/ext4/super.c:4644
       mount_bdev+0x26c/0x3a0 fs/super.c:1368
       legacy_get_tree+0xea/0x180 fs/fs_context.c:610
       vfs_get_tree+0x86/0x270 fs/super.c:1498
       do_new_mount fs/namespace.c:2988 [inline]
       path_mount+0x1986/0x2c30 fs/namespace.c:3318
       do_mount fs/namespace.c:3331 [inline]
       __do_sys_mount fs/namespace.c:3539 [inline]
       __se_sys_mount+0x308/0x3c0 fs/namespace.c:3516
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x44/0xae

-> #0 (&mddev->open_mutex){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3051 [inline]
       check_prevs_add kernel/locking/lockdep.c:3174 [inline]
       validate_chain+0x1dfb/0x8240 kernel/locking/lockdep.c:3789
       __lock_acquire+0x1382/0x2b00 kernel/locking/lockdep.c:5015
       lock_acquire+0x19f/0x4d0 kernel/locking/lockdep.c:5625
       __mutex_lock_common+0x1df/0x2550 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_interruptible_nested+0x1a/0x20 kernel/locking/mutex.c:765
       md_open+0x227/0x320 drivers/md/md.c:7815
       blkdev_get_whole+0x95/0x3e0 block/bdev.c:668
       blkdev_get_by_dev+0x28d/0xb90 block/bdev.c:823
       ext4_blkdev_get fs/ext4/super.c:1079 [inline]
       ext4_get_dev_journal fs/ext4/super.c:5185 [inline]
       ext4_load_journal fs/ext4/super.c:5296 [inline]
       ext4_fill_super+0x9d37/0xf160 fs/ext4/super.c:4644
       mount_bdev+0x26c/0x3a0 fs/super.c:1368
       legacy_get_tree+0xea/0x180 fs/fs_context.c:610
       vfs_get_tree+0x86/0x270 fs/super.c:1498
       do_new_mount fs/namespace.c:2988 [inline]
       path_mount+0x1986/0x2c30 fs/namespace.c:3318
       do_mount fs/namespace.c:3331 [inline]
       __do_sys_mount fs/namespace.c:3539 [inline]
       __se_sys_mount+0x308/0x3c0 fs/namespace.c:3516
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x44/0xae

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&disk->open_mutex);
                               lock(&mddev->open_mutex);
                               lock(&disk->open_mutex);
  lock(&mddev->open_mutex);

 *** DEADLOCK ***

2 locks held by syz-executor.3/22450:
 #0: ffff8880268640e0 (&type->s_umount_key#26/1){+.+.}-{3:3}, at: alloc_super+0x1c8/0x860 fs/super.c:229
 #1: ffff88807e3f6918 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0xf6/0xb90 block/bdev.c:816

stack backtrace:
CPU: 1 PID: 22450 Comm: syz-executor.3 Not tainted 5.15.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1dc/0x2d8 lib/dump_stack.c:106
 check_noncircular+0x2f9/0x3b0 kernel/locking/lockdep.c:2131
 check_prev_add kernel/locking/lockdep.c:3051 [inline]
 check_prevs_add kernel/locking/lockdep.c:3174 [inline]
 validate_chain+0x1dfb/0x8240 kernel/locking/lockdep.c:3789
 __lock_acquire+0x1382/0x2b00 kernel/locking/lockdep.c:5015
 lock_acquire+0x19f/0x4d0 kernel/locking/lockdep.c:5625
 __mutex_lock_common+0x1df/0x2550 kernel/locking/mutex.c:596
 __mutex_lock kernel/locking/mutex.c:729 [inline]
 mutex_lock_interruptible_nested+0x1a/0x20 kernel/locking/mutex.c:765
 md_open+0x227/0x320 drivers/md/md.c:7815
 blkdev_get_whole+0x95/0x3e0 block/bdev.c:668
 blkdev_get_by_dev+0x28d/0xb90 block/bdev.c:823
 ext4_blkdev_get fs/ext4/super.c:1079 [inline]
 ext4_get_dev_journal fs/ext4/super.c:5185 [inline]
 ext4_load_journal fs/ext4/super.c:5296 [inline]
 ext4_fill_super+0x9d37/0xf160 fs/ext4/super.c:4644
 mount_bdev+0x26c/0x3a0 fs/super.c:1368
 legacy_get_tree+0xea/0x180 fs/fs_context.c:610
 vfs_get_tree+0x86/0x270 fs/super.c:1498
 do_new_mount fs/namespace.c:2988 [inline]
 path_mount+0x1986/0x2c30 fs/namespace.c:3318
 do_mount fs/namespace.c:3331 [inline]
 __do_sys_mount fs/namespace.c:3539 [inline]
 __se_sys_mount+0x308/0x3c0 fs/namespace.c:3516
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fab53960c2a
Code: 48 c7 c2 bc ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fab50ed5fa8 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 00007fab53960c2a
RDX: 0000000020000000 RSI: 0000000020001d40 RDI: 00007fab50ed6000
RBP: 00007fab50ed6040 R08: 00007fab50ed6040 R09: 0000000020000000
R10: 0000000000400001 R11: 0000000000000206 R12: 0000000020000000
R13: 0000000020001d40 R14: 00007fab50ed6000 R15: 0000000020000140
EXT4-fs (loop3): couldn't read superblock of external journal