====================================================== WARNING: possible circular locking dependency detected 6.1.137-syzkaller #0 Not tainted ------------------------------------------------------ syz.3.393/5622 is trying to acquire lock: ffff0000e12e6a20 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_read_virt_blocks+0x244/0x8e0 fs/ocfs2/extent_map.c:976 but task is already holding lock: ffff0000d04b2990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0xfb8/0x122c fs/jbd2/transaction.c:461 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (jbd2_handle){++++}-{0:0}: start_this_handle+0xfe0/0x122c fs/jbd2/transaction.c:463 jbd2__journal_start+0x288/0x51c fs/jbd2/transaction.c:520 jbd2_journal_start+0x3c/0x4c fs/jbd2/transaction.c:559 ocfs2_start_trans+0x380/0x6c4 fs/ocfs2/journal.c:354 ocfs2_mknod+0xc7c/0x1f18 fs/ocfs2/namei.c:361 ocfs2_create+0x19c/0x4f0 fs/ocfs2/namei.c:674 lookup_open fs/namei.c:3482 [inline] open_last_lookups fs/namei.c:3550 [inline] path_openat+0x112c/0x2680 fs/namei.c:3780 do_filp_open+0x174/0x344 fs/namei.c:3810 do_sys_openat2+0x128/0x3d8 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] __arm64_sys_openat+0x120/0x154 fs/open.c:1345 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #2 (&journal->j_trans_barrier){.+.+}-{3:3}: down_read+0x64/0x304 kernel/locking/rwsem.c:1520 ocfs2_start_trans+0x374/0x6c4 fs/ocfs2/journal.c:352 ocfs2_mknod+0xc7c/0x1f18 fs/ocfs2/namei.c:361 ocfs2_create+0x19c/0x4f0 fs/ocfs2/namei.c:674 lookup_open fs/namei.c:3482 [inline] open_last_lookups fs/namei.c:3550 [inline] path_openat+0x112c/0x2680 fs/namei.c:3780 do_filp_open+0x174/0x344 fs/namei.c:3810 do_sys_openat2+0x128/0x3d8 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] __arm64_sys_openat+0x120/0x154 fs/open.c:1345 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #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+0x20c/0x6c4 fs/ocfs2/journal.c:350 ocfs2_setattr+0xafc/0x18d4 fs/ocfs2/file.c:1263 notify_change+0xb0c/0xdcc fs/attr.c:499 ovl_do_notify_change fs/overlayfs/overlayfs.h:142 [inline] ovl_workdir_create+0x4a8/0x634 fs/overlayfs/super.c:833 ovl_make_workdir fs/overlayfs/super.c:1389 [inline] ovl_get_workdir+0x2fc/0x1068 fs/overlayfs/super.c:1539 ovl_fill_super+0x139c/0x2294 fs/overlayfs/super.c:2095 mount_nodev+0x68/0x104 fs/super.c:1489 ovl_mount+0x3c/0x50 fs/overlayfs/super.c:2186 legacy_get_tree+0xd4/0x16c fs/fs_context.c:632 vfs_get_tree+0x90/0x274 fs/super.c:1573 do_new_mount+0x228/0x810 fs/namespace.c:3057 path_mount+0x5b4/0xe78 fs/namespace.c:3387 do_mount fs/namespace.c:3400 [inline] __do_sys_mount fs/namespace.c:3608 [inline] __se_sys_mount fs/namespace.c:3585 [inline] __arm64_sys_mount+0x49c/0x584 fs/namespace.c:3585 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #0 (&ocfs2_file_ip_alloc_sem_key){++++}-{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+0x293c/0x6544 kernel/locking/lockdep.c:5049 lock_acquire+0x20c/0x644 kernel/locking/lockdep.c:5662 down_read+0x64/0x304 kernel/locking/rwsem.c:1520 ocfs2_read_virt_blocks+0x244/0x8e0 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+0x318/0x1c5c fs/ocfs2/dir.c:1091 ocfs2_find_files_on_disk+0x128/0x410 fs/ocfs2/dir.c:1995 ocfs2_lookup_ino_from_name+0x60/0x114 fs/ocfs2/dir.c:2017 ocfs2_find_victim_alloc_group+0x198/0x7c0 fs/ocfs2/move_extents.c:379 ocfs2_move_extent fs/ocfs2/move_extents.c:650 [inline] __ocfs2_move_extents_range+0x154c/0x2aac fs/ocfs2/move_extents.c:860 ocfs2_move_extents+0x314/0x7e0 fs/ocfs2/move_extents.c:927 ocfs2_ioctl_move_extents+0x3fc/0x5c8 fs/ocfs2/move_extents.c:1053 ocfs2_ioctl+0x204/0xaf4 fs/ocfs2/ioctl.c:930 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 other info that might help us debug this: Chain exists of: &ocfs2_file_ip_alloc_sem_key --> &journal->j_trans_barrier --> jbd2_handle Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(jbd2_handle); lock(&journal->j_trans_barrier); lock(jbd2_handle); lock(&ocfs2_file_ip_alloc_sem_key); *** DEADLOCK *** 9 locks held by syz.3.393/5622: #0: ffff0000cbf86460 (sb_writers#22){.+.+}-{0:0}, at: mnt_want_write_file+0x64/0x1e8 fs/namespace.c:437 #1: ffff0000fe01b488 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff0000fe01b488 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: ocfs2_move_extents+0x16c/0x7e0 fs/ocfs2/move_extents.c:905 #2: ffff0000fe01b120 (&oi->ip_alloc_sem){++++}-{3:3}, at: ocfs2_move_extents+0x308/0x7e0 fs/ocfs2/move_extents.c:925 #3: ffff0000e11b5f48 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #3: ffff0000e11b5f48 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x12c/0x3cd4 fs/ocfs2/suballoc.c:782 #4: ffff0000f4efb488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #4: ffff0000f4efb488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{3:3}, at: ocfs2_move_extent fs/ocfs2/move_extents.c:632 [inline] #4: ffff0000f4efb488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{3:3}, at: __ocfs2_move_extents_range+0xe40/0x2aac fs/ocfs2/move_extents.c:860 #5: ffff0000fe01a648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #5: ffff0000fe01a648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}, at: ocfs2_move_extent fs/ocfs2/move_extents.c:640 [inline] #5: ffff0000fe01a648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}, at: __ocfs2_move_extents_range+0x1380/0x2aac fs/ocfs2/move_extents.c:860 #6: ffff0000cbf86650 (sb_internal#4){.+.+}-{0:0}, at: ocfs2_move_extent fs/ocfs2/move_extents.c:642 [inline] #6: ffff0000cbf86650 (sb_internal#4){.+.+}-{0:0}, at: __ocfs2_move_extents_range+0x138c/0x2aac fs/ocfs2/move_extents.c:860 #7: ffff0000f4ba6ce8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x374/0x6c4 fs/ocfs2/journal.c:352 #8: ffff0000d04b2990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0xfb8/0x122c fs/jbd2/transaction.c:461 stack backtrace: CPU: 0 PID: 5622 Comm: syz.3.393 Not tainted 6.1.137-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 print_circular_bug+0x148/0x1b0 kernel/locking/lockdep.c:2048 check_noncircular+0x240/0x2d4 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+0x293c/0x6544 kernel/locking/lockdep.c:5049 lock_acquire+0x20c/0x644 kernel/locking/lockdep.c:5662 down_read+0x64/0x304 kernel/locking/rwsem.c:1520 ocfs2_read_virt_blocks+0x244/0x8e0 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+0x318/0x1c5c fs/ocfs2/dir.c:1091 ocfs2_find_files_on_disk+0x128/0x410 fs/ocfs2/dir.c:1995 ocfs2_lookup_ino_from_name+0x60/0x114 fs/ocfs2/dir.c:2017 ocfs2_find_victim_alloc_group+0x198/0x7c0 fs/ocfs2/move_extents.c:379 ocfs2_move_extent fs/ocfs2/move_extents.c:650 [inline] __ocfs2_move_extents_range+0x154c/0x2aac fs/ocfs2/move_extents.c:860 ocfs2_move_extents+0x314/0x7e0 fs/ocfs2/move_extents.c:927 ocfs2_ioctl_move_extents+0x3fc/0x5c8 fs/ocfs2/move_extents.c:1053 ocfs2_ioctl+0x204/0xaf4 fs/ocfs2/ioctl.c:930 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:856 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585