REISERFS (device loop0): Using tea hash to sort names REISERFS (device loop0): Created .reiserfs_priv - reserved for xattr storage. ====================================================== WARNING: possible circular locking dependency detected 6.9.0-rc2-syzkaller-00042-g3e92c1e6cd87 #0 Not tainted ------------------------------------------------------ syz-executor.0/6362 is trying to acquire lock: ffff0000d7963090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x7c/0xe8 fs/reiserfs/lock.c:27 but task is already holding lock: ffff0000c0a84420 (sb_writers#12){.+.+}-{0:0}, at: file_accessed include/linux/fs.h:2457 [inline] ffff0000c0a84420 (sb_writers#12){.+.+}-{0:0}, at: iterate_dir+0x460/0x580 fs/readdir.c:113 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (sb_writers#12){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1662 [inline] sb_start_write+0x60/0x2ec include/linux/fs.h:1798 mnt_want_write_file+0x64/0x1e8 fs/namespace.c:453 reiserfs_ioctl+0x188/0x42c fs/reiserfs/ioctl.c:103 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl fs/ioctl.c:890 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:890 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 -> #0 (&sbi->lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x3384/0x763c kernel/locking/lockdep.c:5137 lock_acquire+0x248/0x73c kernel/locking/lockdep.c:5754 __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:608 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:804 reiserfs_write_lock+0x7c/0xe8 fs/reiserfs/lock.c:27 reiserfs_dirty_inode+0xe4/0x204 fs/reiserfs/super.c:703 __mark_inode_dirty+0x2e0/0x11a4 fs/fs-writeback.c:2477 generic_update_time fs/inode.c:1907 [inline] inode_update_time fs/inode.c:1920 [inline] touch_atime+0x620/0xae4 fs/inode.c:1992 file_accessed include/linux/fs.h:2457 [inline] iterate_dir+0x460/0x580 fs/readdir.c:113 __do_sys_getdents64 fs/readdir.c:409 [inline] __se_sys_getdents64 fs/readdir.c:394 [inline] __arm64_sys_getdents64+0x1c4/0x4a0 fs/readdir.c:394 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(sb_writers#12); lock(&sbi->lock); lock(sb_writers#12); lock(&sbi->lock); *** DEADLOCK *** 3 locks held by syz-executor.0/6362: #0: ffff0000d682e5c8 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x218/0x2a4 fs/file.c:1191 #1: ffff0000db4b82e0 (&type->i_mutex_dir_key#8){++++}-{3:3}, at: iterate_dir+0x340/0x580 fs/readdir.c:103 #2: ffff0000c0a84420 (sb_writers#12){.+.+}-{0:0}, at: file_accessed include/linux/fs.h:2457 [inline] #2: ffff0000c0a84420 (sb_writers#12){.+.+}-{0:0}, at: iterate_dir+0x460/0x580 fs/readdir.c:113 stack backtrace: CPU: 0 PID: 6362 Comm: syz-executor.0 Not tainted 6.9.0-rc2-syzkaller-00042-g3e92c1e6cd87 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:317 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:324 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:114 dump_stack+0x1c/0x28 lib/dump_stack.c:123 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2060 check_noncircular+0x310/0x404 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x3384/0x763c kernel/locking/lockdep.c:5137 lock_acquire+0x248/0x73c kernel/locking/lockdep.c:5754 __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:608 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:804 reiserfs_write_lock+0x7c/0xe8 fs/reiserfs/lock.c:27 reiserfs_dirty_inode+0xe4/0x204 fs/reiserfs/super.c:703 __mark_inode_dirty+0x2e0/0x11a4 fs/fs-writeback.c:2477 generic_update_time fs/inode.c:1907 [inline] inode_update_time fs/inode.c:1920 [inline] touch_atime+0x620/0xae4 fs/inode.c:1992 file_accessed include/linux/fs.h:2457 [inline] iterate_dir+0x460/0x580 fs/readdir.c:113 __do_sys_getdents64 fs/readdir.c:409 [inline] __se_sys_getdents64 fs/readdir.c:394 [inline] __arm64_sys_getdents64+0x1c4/0x4a0 fs/readdir.c:394 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598