====================================================== WARNING: possible circular locking dependency detected 6.1.141-syzkaller #0 Not tainted ------------------------------------------------------ syz.3.183/5142 is trying to acquire lock: ffff0000e1a6bf60 (&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: ffff0000f1830990 (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:376 ocfs2_shutdown_local_alloc+0x1ac/0x7e4 fs/ocfs2/localalloc.c:416 ocfs2_dismount_volume+0x1f0/0x93c fs/ocfs2/super.c:1882 ocfs2_put_super+0x108/0x390 fs/ocfs2/super.c:1609 generic_shutdown_super+0x130/0x324 fs/super.c:501 kill_block_super+0x70/0xdc fs/super.c:1470 deactivate_locked_super+0xac/0x124 fs/super.c:332 deactivate_super+0xe8/0x108 fs/super.c:363 cleanup_mnt+0x37c/0x404 fs/namespace.c:1182 __cleanup_mnt+0x20/0x30 fs/namespace.c:1189 task_work_run+0x1ec/0x270 kernel/task_work.c:203 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x1f70/0x2b0c arch/arm64/kernel/signal.c:1137 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline] el0_svc+0x98/0x138 arch/arm64/kernel/entry-common.c:638 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:374 ocfs2_shutdown_local_alloc+0x1ac/0x7e4 fs/ocfs2/localalloc.c:416 ocfs2_dismount_volume+0x1f0/0x93c fs/ocfs2/super.c:1882 ocfs2_put_super+0x108/0x390 fs/ocfs2/super.c:1609 generic_shutdown_super+0x130/0x324 fs/super.c:501 kill_block_super+0x70/0xdc fs/super.c:1470 deactivate_locked_super+0xac/0x124 fs/super.c:332 deactivate_super+0xe8/0x108 fs/super.c:363 cleanup_mnt+0x37c/0x404 fs/namespace.c:1182 __cleanup_mnt+0x20/0x30 fs/namespace.c:1189 task_work_run+0x1ec/0x270 kernel/task_work.c:203 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x1f70/0x2b0c arch/arm64/kernel/signal.c:1137 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline] el0_svc+0x98/0x138 arch/arm64/kernel/entry-common.c:638 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:372 ocfs2_setattr+0xafc/0x18d4 fs/ocfs2/file.c:1263 notify_change+0xb0c/0xdcc fs/attr.c:499 chmod_common+0x1dc/0x344 fs/open.c:606 do_fchmodat+0xcc/0x1d0 fs/open.c:645 __do_sys_fchmodat fs/open.c:658 [inline] __se_sys_fchmodat fs/open.c:655 [inline] __arm64_sys_fchmodat+0x7c/0x94 fs/open.c:655 __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.183/5142: #0: ffff0000d55b6460 (sb_writers#17){.+.+}-{0:0}, at: mnt_want_write_file+0x64/0x1e8 fs/namespace.c:437 #1: ffff0000f52d09c8 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff0000f52d09c8 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: ocfs2_move_extents+0x16c/0x7e0 fs/ocfs2/move_extents.c:905 #2: ffff0000f52d0660 (&oi->ip_alloc_sem){+.+.}-{3:3}, at: ocfs2_move_extents+0x308/0x7e0 fs/ocfs2/move_extents.c:925 #3: ffff0000f525b488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #3: ffff0000f525b488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x12c/0x3cd4 fs/ocfs2/suballoc.c:782 #4: ffff0000f5259808 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #4: ffff0000f5259808 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: ocfs2_move_extent fs/ocfs2/move_extents.c:632 [inline] #4: ffff0000f5259808 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: __ocfs2_move_extents_range+0xe40/0x2aac fs/ocfs2/move_extents.c:860 #5: ffff0000f525ed88 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #5: ffff0000f525ed88 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: ocfs2_move_extent fs/ocfs2/move_extents.c:640 [inline] #5: ffff0000f525ed88 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2){+.+.}-{3:3}, at: __ocfs2_move_extents_range+0x1380/0x2aac fs/ocfs2/move_extents.c:860 #6: ffff0000d55b6650 (sb_internal#4){.+.+}-{0:0}, at: ocfs2_move_extent fs/ocfs2/move_extents.c:642 [inline] #6: ffff0000d55b6650 (sb_internal#4){.+.+}-{0:0}, at: __ocfs2_move_extents_range+0x138c/0x2aac fs/ocfs2/move_extents.c:860 #7: ffff0000f23238e8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x374/0x6c4 fs/ocfs2/journal.c:374 #8: ffff0000f1830990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0xfb8/0x122c fs/jbd2/transaction.c:461 stack backtrace: CPU: 1 PID: 5142 Comm: syz.3.183 Not tainted 6.1.141-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/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