md/raid1:md0: active with 1 out of 2 mirrors ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz-executor304/5608 is trying to acquire lock: ffff88803408c340 (&mddev->reconfig_mutex){+.+.}-{4:4}, at: mddev_lock drivers/md/md.h:713 [inline] ffff88803408c340 (&mddev->reconfig_mutex){+.+.}-{4:4}, at: mddev_suspend_and_lock drivers/md/md.h:1019 [inline] ffff88803408c340 (&mddev->reconfig_mutex){+.+.}-{4:4}, at: location_store+0xc6/0xc80 drivers/md/md-bitmap.c:2636 but task is already holding lock: ffff88803422f008 (kn->active#54){++++}-{0:0}, at: kernfs_get_active_of fs/kernfs/file.c:73 [inline] ffff88803422f008 (kn->active#54){++++}-{0:0}, at: kernfs_fop_write_iter+0x22c/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#54){++++}-{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+0x3a5/0x540 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x61e/0xbb0 fs/read_write.c:687 ksys_write+0x156/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:3209 [inline] check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x164c/0x2de0 kernel/locking/lockdep.c:5288 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942 __mutex_lock_common kernel/locking/rtmutex_api.c:561 [inline] mutex_lock_interruptible_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:594 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+0x3a5/0x540 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x61e/0xbb0 fs/read_write.c:687 ksys_write+0x156/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#54); lock(&mddev->reconfig_mutex); lock(kn->active#54); lock(&mddev->reconfig_mutex); *** DEADLOCK *** locks held by syz-executor304/5608: 4, last CPU#1: #0: ffff888011699d28 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x252/0x320 fs/file.c:1259 #1: ffff8880369ec510 (sb_writers#7){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2753 [inline] #1: ffff8880369ec510 (sb_writers#7){.+.+}-{0:0}, at: vfs_write+0x231/0xbb0 fs/read_write.c:683 #2: ffff8880341f2478 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x1d9/0x540 fs/kernfs/file.c:336 #3: ffff88803422f008 (kn->active#54){++++}-{0:0}, at: kernfs_get_active_of fs/kernfs/file.c:73 [inline] #3: ffff88803422f008 (kn->active#54){++++}-{0:0}, at: kernfs_fop_write_iter+0x22c/0x540 fs/kernfs/file.c:337 stack backtrace: CPU: 1 UID: 0 PID: 5608 Comm: syz-executor304 Not tainted syzkaller #0 PREEMPT_{RT,(full)} Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_circular_bug+0x2e2/0x300 kernel/locking/lockdep.c:2087 check_noncircular+0x12f/0x150 kernel/locking/lockdep.c:2219 check_prev_add kernel/locking/lockdep.c:3209 [inline] check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x164c/0x2de0 kernel/locking/lockdep.c:5288 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942 __mutex_lock_common kernel/locking/rtmutex_api.c:561 [inline] mutex_lock_interruptible_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:594 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+0x3a5/0x540 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x61e/0xbb0 fs/read_write.c:687 ksys_write+0x156/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:0x7f8b1f09a369 Code: c0 79 93 eb d5 48 8d 7c 1d 00 eb 99 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 d0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f8b1f0721d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f8b1f14ab88 RCX: 00007f8b1f09a369 RDX: 0000000000000002 RSI: 0000200000000600 RDI: 0000000000000009 RBP: 00007f8b1f14ab80 R08: 35203a6b63617473 R09: 35203a6b63617473 R10: 35203a6b63617473 R11: 0000000000000246 R12: 00007f8b1f11c378 R13: 00002000000005c0 R14: 0000200000000580 R15: 0000200000000600