====================================================== WARNING: possible circular locking dependency detected 6.1.141-syzkaller #0 Not tainted ------------------------------------------------------ syz.0.212/5294 is trying to acquire lock: ffff8880549f6a20 (&oi->ip_alloc_sem){++++}-{3:3}, at: ocfs2_read_virt_blocks+0x265/0x950 fs/ocfs2/extent_map.c:976 but task is already holding lock: ffff8880300f8990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x1f29/0x2150 fs/jbd2/transaction.c:463 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (jbd2_handle){++++}-{0:0}: start_this_handle+0x1f49/0x2150 fs/jbd2/transaction.c:463 jbd2__journal_start+0x2b7/0x5a0 fs/jbd2/transaction.c:520 jbd2_journal_start+0x26/0x30 fs/jbd2/transaction.c:559 ocfs2_start_trans+0x372/0x6c0 fs/ocfs2/journal.c:376 ocfs2_mknod+0xe6a/0x2350 fs/ocfs2/namei.c:361 ocfs2_create+0x1b6/0x4a0 fs/ocfs2/namei.c:674 lookup_open fs/namei.c:3482 [inline] open_last_lookups fs/namei.c:3550 [inline] path_openat+0x1187/0x2e70 fs/namei.c:3780 do_filp_open+0x1c1/0x3c0 fs/namei.c:3810 do_sys_openat2+0x142/0x490 fs/open.c:1318 do_sys_open fs/open.c:1334 [inline] __do_sys_openat fs/open.c:1350 [inline] __se_sys_openat fs/open.c:1345 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1345 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #2 (&journal->j_trans_barrier){.+.+}-{3:3}: down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520 ocfs2_start_trans+0x366/0x6c0 fs/ocfs2/journal.c:374 ocfs2_mknod+0xe6a/0x2350 fs/ocfs2/namei.c:361 ocfs2_create+0x1b6/0x4a0 fs/ocfs2/namei.c:674 lookup_open fs/namei.c:3482 [inline] open_last_lookups fs/namei.c:3550 [inline] path_openat+0x1187/0x2e70 fs/namei.c:3780 do_filp_open+0x1c1/0x3c0 fs/namei.c:3810 do_sys_openat2+0x142/0x490 fs/open.c:1318 do_sys_open fs/open.c:1334 [inline] __do_sys_openat fs/open.c:1350 [inline] __se_sys_openat fs/open.c:1345 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1345 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #1 (sb_internal#4){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1891 [inline] sb_start_intwrite include/linux/fs.h:2013 [inline] ocfs2_start_trans+0x267/0x6c0 fs/ocfs2/journal.c:372 ocfs2_zero_start_ordered_transaction fs/ocfs2/file.c:719 [inline] ocfs2_write_zero_page fs/ocfs2/file.c:765 [inline] ocfs2_zero_extend_range fs/ocfs2/file.c:949 [inline] ocfs2_zero_extend+0x952/0x2950 fs/ocfs2/file.c:994 ocfs2_extend_no_holes+0x264/0x490 fs/ocfs2/file.c:1040 ocfs2_extend_file+0x1e1/0x500 fs/ocfs2/file.c:1095 ocfs2_setattr+0xb77/0x1cf0 fs/ocfs2/file.c:1214 notify_change+0xc74/0xf40 fs/attr.c:499 do_truncate+0x197/0x220 fs/open.c:65 vfs_truncate+0x262/0x2f0 fs/open.c:111 do_sys_truncate+0xdc/0x190 fs/open.c:134 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&oi->ip_alloc_sem){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662 down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520 ocfs2_read_virt_blocks+0x265/0x950 fs/ocfs2/extent_map.c:976 ocfs2_read_dir_block fs/ocfs2/dir.c:508 [inline] ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline] ocfs2_find_entry+0x3d1/0x20c0 fs/ocfs2/dir.c:1091 ocfs2_rename+0x1e13/0x3820 fs/ocfs2/namei.c:1568 vfs_rename+0xbbf/0x10d0 fs/namei.c:4874 do_renameat2+0x89d/0xc70 fs/namei.c:5027 __do_sys_rename fs/namei.c:5073 [inline] __se_sys_rename fs/namei.c:5071 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:5071 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Chain exists of: &oi->ip_alloc_sem --> &journal->j_trans_barrier --> jbd2_handle Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(jbd2_handle); lock(&journal->j_trans_barrier); lock(jbd2_handle); lock(&oi->ip_alloc_sem); *** DEADLOCK *** 8 locks held by syz.0.212/5294: #0: ffff88807a95a460 (sb_writers#18){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:393 #1: ffff88807a95a748 (&type->s_vfs_rename_key#3){+.+.}-{3:3}, at: lock_rename fs/namei.c:3038 [inline] #1: ffff88807a95a748 (&type->s_vfs_rename_key#3){+.+.}-{3:3}, at: do_renameat2+0x35b/0xc70 fs/namei.c:4966 #2: ffff888054b45108 (&type->i_mutex_dir_key#12/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #2: ffff888054b45108 (&type->i_mutex_dir_key#12/1){+.+.}-{3:3}, at: lock_two_directories fs/namei.c:-1 [inline] #2: ffff888054b45108 (&type->i_mutex_dir_key#12/1){+.+.}-{3:3}, at: lock_rename fs/namei.c:3039 [inline] #2: ffff888054b45108 (&type->i_mutex_dir_key#12/1){+.+.}-{3:3}, at: do_renameat2+0x3ed/0xc70 fs/namei.c:4966 #3: ffff8880549f6d88 (&sb->s_type->i_mutex_key#23/5){+.+.}-{3:3}, at: lock_rename include/linux/fs.h:-1 [inline] #3: ffff8880549f6d88 (&sb->s_type->i_mutex_key#23/5){+.+.}-{3:3}, at: do_renameat2+0x423/0xc70 fs/namei.c:4966 #4: ffff8880549f3488 (&sb->s_type->i_mutex_key#23/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #4: ffff8880549f3488 (&sb->s_type->i_mutex_key#23/2){+.+.}-{3:3}, at: vfs_rename+0x78c/0x10d0 fs/namei.c:4837 #5: ffff88807a95a650 (sb_internal#4){.+.+}-{0:0}, at: ocfs2_rename+0x1a0a/0x3820 fs/ocfs2/namei.c:1488 #6: ffff888057baf8e8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x366/0x6c0 fs/ocfs2/journal.c:374 #7: ffff8880300f8990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x1f29/0x2150 fs/jbd2/transaction.c:463 stack backtrace: CPU: 1 PID: 5294 Comm: syz.0.212 Not tainted 6.1.141-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106 check_noncircular+0x274/0x310 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662 down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520 ocfs2_read_virt_blocks+0x265/0x950 fs/ocfs2/extent_map.c:976 ocfs2_read_dir_block fs/ocfs2/dir.c:508 [inline] ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline] ocfs2_find_entry+0x3d1/0x20c0 fs/ocfs2/dir.c:1091 ocfs2_rename+0x1e13/0x3820 fs/ocfs2/namei.c:1568 vfs_rename+0xbbf/0x10d0 fs/namei.c:4874 do_renameat2+0x89d/0xc70 fs/namei.c:5027 __do_sys_rename fs/namei.c:5073 [inline] __se_sys_rename fs/namei.c:5071 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:5071 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7ff2e698e929 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ff2e78e0038 EFLAGS: 00000246 ORIG_RAX: 0000000000000052 RAX: ffffffffffffffda RBX: 00007ff2e6bb5fa0 RCX: 00007ff2e698e929 RDX: 0000000000000000 RSI: 0000200000000380 RDI: 0000200000000040 RBP: 00007ff2e6a10b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007ff2e6bb5fa0 R15: 00007ffec49bb5c8