md: could not open device unknown-block(7,0). ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.1.13/5886 is trying to acquire lock: ffff888033e50358 (&mddev->reconfig_mutex){+.+.}-{4:4}, at: mddev_lock drivers/md/md.h:713 [inline] ffff888033e50358 (&mddev->reconfig_mutex){+.+.}-{4:4}, at: mddev_suspend_and_lock drivers/md/md.h:1019 [inline] ffff888033e50358 (&mddev->reconfig_mutex){+.+.}-{4:4}, at: location_store+0xc6/0xc80 drivers/md/md-bitmap.c:2636 but task is already holding lock: ffff88803395e5a8 (kn->active#67){++++}-{0:0}, at: kernfs_get_active_of fs/kernfs/file.c:73 [inline] ffff88803395e5a8 (kn->active#67){++++}-{0:0}, at: kernfs_fop_write_iter+0x22b/0x540 fs/kernfs/file.c:337 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (kn->active#67){++++}-{0:0}: kernfs_drain+0x293/0x640 fs/kernfs/dir.c:532 __kernfs_remove+0x493/0x8e0 fs/kernfs/dir.c:1579 kernfs_remove_by_name_ns+0xc0/0x140 fs/kernfs/dir.c:1797 kernfs_remove_by_name include/linux/kernfs.h:644 [inline] remove_files fs/sysfs/group.c:28 [inline] sysfs_remove_group+0x101/0x2e0 fs/sysfs/group.c:328 md_bitmap_sysfs_del drivers/md/md.c:707 [inline] md_bitmap_destroy drivers/md/md.c:6635 [inline] __md_stop+0x22a/0x3a0 drivers/md/md.c:7089 do_md_stop+0x2e2/0x1150 drivers/md/md.c:7193 array_state_store+0x802/0xe90 drivers/md/md.c:4713 md_attr_store+0x3b7/0x640 drivers/md/md.c:6158 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x612/0xba0 fs/read_write.c:687 ksys_write+0x150/0x270 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&mddev->reconfig_mutex){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3181 [inline] check_prevs_add kernel/locking/lockdep.c:3300 [inline] validate_chain kernel/locking/lockdep.c:3924 [inline] __lock_acquire+0x15ff/0x2e50 kernel/locking/lockdep.c:5254 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5908 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x19d/0x1550 kernel/locking/mutex.c:821 mddev_lock drivers/md/md.h:713 [inline] mddev_suspend_and_lock drivers/md/md.h:1019 [inline] location_store+0xc6/0xc80 drivers/md/md-bitmap.c:2636 md_attr_store+0x3b7/0x640 drivers/md/md.c:6158 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x612/0xba0 fs/read_write.c:687 ksys_write+0x150/0x270 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(kn->active#67); lock(&mddev->reconfig_mutex); lock(kn->active#67); lock(&mddev->reconfig_mutex); *** DEADLOCK *** locks held by syz.1.13/5886: 4, last CPU#1: #0: ffff8880321ae630 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x246/0x320 fs/file.c:1259 #1: ffff88807b104460 (sb_writers#7){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2753 [inline] #1: ffff88807b104460 (sb_writers#7){.+.+}-{0:0}, at: vfs_write+0x22b/0xba0 fs/read_write.c:683 #2: ffff8880358ba880 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x1d8/0x540 fs/kernfs/file.c:336 #3: ffff88803395e5a8 (kn->active#67){++++}-{0:0}, at: kernfs_get_active_of fs/kernfs/file.c:73 [inline] #3: ffff88803395e5a8 (kn->active#67){++++}-{0:0}, at: kernfs_fop_write_iter+0x22b/0x540 fs/kernfs/file.c:337 stack backtrace: CPU: 1 UID: 0 PID: 5886 Comm: syz.1.13 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/05/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_circular_bug+0x2e2/0x300 kernel/locking/lockdep.c:2059 check_noncircular+0x12f/0x150 kernel/locking/lockdep.c:2191 check_prev_add kernel/locking/lockdep.c:3181 [inline] check_prevs_add kernel/locking/lockdep.c:3300 [inline] validate_chain kernel/locking/lockdep.c:3924 [inline] __lock_acquire+0x15ff/0x2e50 kernel/locking/lockdep.c:5254 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5908 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x19d/0x1550 kernel/locking/mutex.c:821 mddev_lock drivers/md/md.h:713 [inline] mddev_suspend_and_lock drivers/md/md.h:1019 [inline] location_store+0xc6/0xc80 drivers/md/md-bitmap.c:2636 md_attr_store+0x3b7/0x640 drivers/md/md.c:6158 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x612/0xba0 fs/read_write.c:687 ksys_write+0x150/0x270 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f662bd9e159 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f662cc1f028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f662c025fa0 RCX: 00007f662bd9e159 RDX: 0000000000000003 RSI: 0000200000000500 RDI: 000000000000000b RBP: 00007f662be35024 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f662c026038 R14: 00007f662c025fa0 R15: 00007fff983c4f18