============================================ WARNING: possible recursive locking detected 6.5.0-rc1-next-20230714-syzkaller #0 Not tainted -------------------------------------------- kworker/u4:6/2871 is trying to acquire lock: ffff8880162b00b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfsplus_find_init+0x16d/0x200 fs/hfsplus/bfind.c:33 but task is already holding lock: ffff8880162b00b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfsplus_find_init+0x16d/0x200 fs/hfsplus/bfind.c:33 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&tree->tree_lock/1); lock(&tree->tree_lock/1); *** DEADLOCK *** May be due to missing lock nesting notation 5 locks held by kworker/u4:6/2871: #0: ffff88814264c138 ((wq_completion)writeback){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:20 [inline] #0: ffff88814264c138 ((wq_completion)writeback){+.+.}-{0:0}, at: raw_atomic64_set include/linux/atomic/atomic-arch-fallback.h:2608 [inline] #0: ffff88814264c138 ((wq_completion)writeback){+.+.}-{0:0}, at: raw_atomic_long_set include/linux/atomic/atomic-long.h:79 [inline] #0: ffff88814264c138 ((wq_completion)writeback){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:3196 [inline] #0: ffff88814264c138 ((wq_completion)writeback){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:678 [inline] #0: ffff88814264c138 ((wq_completion)writeback){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:705 [inline] #0: ffff88814264c138 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x96a/0x16f0 kernel/workqueue.c:2570 #1: ffffc9000c8a7d80 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x99e/0x16f0 kernel/workqueue.c:2574 #2: ffff88807c27ac88 (&hip->extents_lock){+.+.}-{3:3}, at: hfsplus_ext_write_extent+0x82/0x200 fs/hfsplus/extents.c:149 #3: ffff8880162b00b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfsplus_find_init+0x16d/0x200 fs/hfsplus/bfind.c:33 #4: ffff88807c278108 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1c5/0xf90 fs/hfsplus/extents.c:457 stack backtrace: CPU: 1 PID: 2871 Comm: kworker/u4:6 Not tainted 6.5.0-rc1-next-20230714-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023 Workqueue: writeback wb_workfn (flush-7:0) Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_deadlock kernel/locking/lockdep.c:3070 [inline] validate_chain kernel/locking/lockdep.c:3863 [inline] __lock_acquire+0x2971/0x5de0 kernel/locking/lockdep.c:5144 lock_acquire kernel/locking/lockdep.c:5761 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5726 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x181/0x1340 kernel/locking/mutex.c:747 hfsplus_find_init+0x16d/0x200 fs/hfsplus/bfind.c:33 hfsplus_ext_read_extent+0x199/0xb00 fs/hfsplus/extents.c:216 hfsplus_file_extend+0x699/0xf90 fs/hfsplus/extents.c:461 hfsplus_bmap_reserve+0x318/0x410 fs/hfsplus/btree.c:358 __hfsplus_ext_write_extent+0x470/0x5e0 fs/hfsplus/extents.c:104 hfsplus_ext_write_extent_locked fs/hfsplus/extents.c:139 [inline] hfsplus_ext_write_extent_locked fs/hfsplus/extents.c:129 [inline] hfsplus_ext_write_extent+0x1c5/0x200 fs/hfsplus/extents.c:150 hfsplus_write_inode+0x22/0x4f0 fs/hfsplus/super.c:154 write_inode fs/fs-writeback.c:1456 [inline] __writeback_single_inode+0xa81/0xe70 fs/fs-writeback.c:1668 writeback_sb_inodes+0x599/0x1010 fs/fs-writeback.c:1894 wb_writeback+0x2a5/0xa90 fs/fs-writeback.c:2070 wb_do_writeback fs/fs-writeback.c:2217 [inline] wb_workfn+0x29c/0xfd0 fs/fs-writeback.c:2257 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600 worker_thread+0x687/0x1110 kernel/workqueue.c:2751 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:296 RIP: 0000:0x0 Code: Unable to access opcode bytes at 0xffffffffffffffd6. RSP: 0000:0000000000000000 EFLAGS: 00000000 ORIG_RAX: 0000000000000000 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000