====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.0.52/4621 is trying to acquire lock: ffff88805b518660 (&oi->ip_alloc_sem/1){+.+.}-{3:3}, at: ocfs2_xattr_set_handle+0x3f9/0x820 fs/ocfs2/xattr.c:3591 but task is already holding lock: ffff888020be0990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x12d5/0x1560 fs/jbd2/transaction.c:462 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (jbd2_handle){++++}-{0:0}: jbd2_journal_lock_updates+0xa4/0x390 fs/jbd2/transaction.c:881 __ocfs2_flush_truncate_log+0x2b4/0x1110 fs/ocfs2/alloc.c:6031 ocfs2_flush_truncate_log+0x4b/0x60 fs/ocfs2/alloc.c:6078 ocfs2_sync_fs+0x119/0x330 fs/ocfs2/super.c:404 sync_filesystem+0x1be/0x220 fs/sync.c:66 generic_shutdown_super+0x6b/0x300 fs/super.c:448 kill_block_super+0x7c/0xe0 fs/super.c:1438 deactivate_locked_super+0x93/0xf0 fs/super.c:335 cleanup_mnt+0x426/0x4d0 fs/namespace.c:1148 task_work_run+0x125/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:184 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:217 __syscall_exit_to_user_mode_work kernel/entry/common.c:299 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:310 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #2 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}: down_write+0x38/0x60 kernel/locking/rwsem.c:1551 inode_lock include/linux/fs.h:795 [inline] ocfs2_remove_btree_range+0x64f/0x15e0 fs/ocfs2/alloc.c:5746 ocfs2_commit_truncate+0xb62/0x1d30 fs/ocfs2/alloc.c:7350 ocfs2_truncate_file+0xd89/0x1540 fs/ocfs2/file.c:526 ocfs2_setattr+0x12f8/0x1b50 fs/ocfs2/file.c:1240 notify_change+0xbc6/0xee0 fs/attr.c:505 do_truncate+0x1ac/0x240 fs/open.c:65 do_sys_ftruncate+0x31b/0x3d0 fs/open.c:193 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #1 (&new->rf_sem){+.+.}-{3:3}: down_write+0x38/0x60 kernel/locking/rwsem.c:1551 __ocfs2_lock_refcount_tree fs/ocfs2/refcounttree.c:459 [inline] ocfs2_lock_refcount_tree+0x15f/0x990 fs/ocfs2/refcounttree.c:492 ocfs2_set_refcount_tree+0x162/0x770 fs/ocfs2/refcounttree.c:735 ocfs2_reflink_remap_blocks+0x6a2/0x1ab0 fs/ocfs2/refcounttree.c:4727 ocfs2_remap_file_range+0x4a7/0x740 fs/ocfs2/file.c:2736 vfs_copy_file_range+0xf5c/0x1520 fs/read_write.c:1512 __do_sys_copy_file_range fs/read_write.c:1590 [inline] __se_sys_copy_file_range+0x320/0x470 fs/read_write.c:1553 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 ( &oi->ip_alloc_sem/1){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3125 [inline] check_prevs_add kernel/locking/lockdep.c:3244 [inline] validate_chain kernel/locking/lockdep.c:3860 [inline] __lock_acquire+0x39b7/0x7e20 kernel/locking/lockdep.c:5134 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5751 down_write_nested+0x3b/0x60 kernel/locking/rwsem.c:1667 ocfs2_xattr_set_handle+0x3f9/0x820 fs/ocfs2/xattr.c:3591 ocfs2_set_acl+0x4a5/0x580 fs/ocfs2/acl.c:249 ocfs2_init_acl+0x3b7/0x420 fs/ocfs2/acl.c:443 ocfs2_mknod+0x151f/0x2460 fs/ocfs2/namei.c:409 ocfs2_create+0x192/0x420 fs/ocfs2/namei.c:675 lookup_open fs/namei.c:3513 [inline] open_last_lookups fs/namei.c:3583 [inline] path_openat+0x120a/0x2fb0 fs/namei.c:3790 do_filp_open+0x1df/0x400 fs/namei.c:3820 do_sys_openat2+0x14b/0x500 fs/open.c:1255 do_sys_open fs/open.c:1271 [inline] __do_sys_openat fs/open.c:1287 [inline] __se_sys_openat fs/open.c:1282 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1282 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Chain exists of: &oi->ip_alloc_sem/1 --> &ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5 --> jbd2_handle Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(jbd2_handle); lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5); lock(jbd2_handle); lock(&oi->ip_alloc_sem/1); *** DEADLOCK *** 8 locks held by syz.0.52/4621: #0: ffff888076212460 (sb_writers#17){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:386 #1: ffff88805b5089c8 (&type->i_mutex_dir_key#12){++++}-{3:3}, at: inode_lock include/linux/fs.h:795 [inline] #1: ffff88805b5089c8 (&type->i_mutex_dir_key#12){++++}-{3:3}, at: open_last_lookups fs/namei.c:3580 [inline] #1: ffff88805b5089c8 (&type->i_mutex_dir_key#12){++++}-{3:3}, at: path_openat+0x821/0x2fb0 fs/namei.c:3790 #2: ffff88805b512648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#2 ){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:795 [inline] ){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x16d/0x44b0 fs/ocfs2/suballoc.c:804 #3: ffff88805b511808 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type] #3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:795 [inline] #3){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x16d/0x44b0 fs/ocfs2/suballoc.c:804 #4: ffff88805b5142c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type] #4){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:795 [inline] #4){+.+.}-{3:3}, at: ocfs2_reserve_local_alloc_bits+0x11c/0x2630 fs/ocfs2/localalloc.c:635 #5: ffff888076212650 (sb_internal#4 ){.+.+}-{0:0}, at: ocfs2_mknod+0xf20/0x2460 fs/ocfs2/namei.c:360 #6: ffff888061d72ce8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3a6/0x6f0 fs/ocfs2/journal.c:384 #7: ffff888020be0990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x12d5/0x1560 fs/jbd2/transaction.c:462 stack backtrace: CPU: 1 PID: 4621 Comm: syz.0.52 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 check_noncircular+0x2f8/0x400 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3125 [inline] check_prevs_add kernel/locking/lockdep.c:3244 [inline] validate_chain kernel/locking/lockdep.c:3860 [inline] __lock_acquire+0x39b7/0x7e20 kernel/locking/lockdep.c:5134 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5751 down_write_nested+0x3b/0x60 kernel/locking/rwsem.c:1667 ocfs2_xattr_set_handle+0x3f9/0x820 fs/ocfs2/xattr.c:3591 ocfs2_set_acl+0x4a5/0x580 fs/ocfs2/acl.c:249 ocfs2_init_acl+0x3b7/0x420 fs/ocfs2/acl.c:443 ocfs2_mknod+0x151f/0x2460 fs/ocfs2/namei.c:409 ocfs2_create+0x192/0x420 fs/ocfs2/namei.c:675 lookup_open fs/namei.c:3513 [inline] open_last_lookups fs/namei.c:3583 [inline] path_openat+0x120a/0x2fb0 fs/namei.c:3790 do_filp_open+0x1df/0x400 fs/namei.c:3820 do_sys_openat2+0x14b/0x500 fs/open.c:1255 do_sys_open fs/open.c:1271 [inline] __do_sys_openat fs/open.c:1287 [inline] __se_sys_openat fs/open.c:1282 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1282 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fe55528fa99 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fe5534bb028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fe55551c098 RCX: 00007fe55528fa99 RDX: 0000000000000042 RSI: 0000200000004b00 RDI: ffffffffffffff9c RBP: 00007fe55531f18b R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fe55551c130 R14: 00007fe55551c098 R15: 00007ffd82698b48 kcov: kcov_task_exit: t = ffff888022f10000, kcov->t = ffff888022f10000