loop8: detected capacity change from 0 to 32768 JBD2: Ignoring recovery information on journal ocfs2: Mounting device (7,8) on (node local, slot 0) with ordered data mode. ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.8.2218/11249 is trying to acquire lock: ffff888077616a20 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_reflink+0x4cb/0x920 fs/ocfs2/refcounttree.c:4276 but task is already holding lock: ffff888077616ab8 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_reflink+0x4bc/0x920 fs/ocfs2/refcounttree.c:4275 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&oi->ip_xattr_sem){++++}-{3:3}: down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520 ocfs2_init_acl+0x307/0x770 fs/ocfs2/acl.c:365 ocfs2_mknod+0x18e0/0x2580 fs/ocfs2/namei.c:410 ocfs2_create+0x1b6/0x4b0 fs/ocfs2/namei.c:674 lookup_open fs/namei.c:3490 [inline] open_last_lookups fs/namei.c:3558 [inline] path_openat+0x11b9/0x2f10 fs/namei.c:3788 do_filp_open+0x1ee/0x420 fs/namei.c:3818 do_sys_openat2+0x14b/0x4f0 fs/open.c:1320 do_sys_open fs/open.c:1336 [inline] __do_sys_openat fs/open.c:1352 [inline] __se_sys_openat fs/open.c:1347 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1347 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 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+0x3a4/0x6f0 fs/ocfs2/journal.c:374 ocfs2_mknod+0x1273/0x2580 fs/ocfs2/namei.c:361 ocfs2_create+0x1b6/0x4b0 fs/ocfs2/namei.c:674 lookup_open fs/namei.c:3490 [inline] open_last_lookups fs/namei.c:3558 [inline] path_openat+0x11b9/0x2f10 fs/namei.c:3788 do_filp_open+0x1ee/0x420 fs/namei.c:3818 do_sys_openat2+0x14b/0x4f0 fs/open.c:1320 do_sys_open fs/open.c:1336 [inline] __do_sys_openat fs/open.c:1352 [inline] __se_sys_openat fs/open.c:1347 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1347 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 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+0x2a5/0x6f0 fs/ocfs2/journal.c:372 ocfs2_setattr+0xdb2/0x1d90 fs/ocfs2/file.c:1263 notify_change+0xca0/0xf90 fs/attr.c:499 chmod_common+0x253/0x400 fs/open.c:606 do_fchmodat+0xd4/0x1a0 fs/open.c:645 __do_sys_fchmodat fs/open.c:658 [inline] __se_sys_fchmodat fs/open.c:655 [inline] __x64_sys_fchmodat+0x77/0x90 fs/open.c:655 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3830 [inline] __lock_acquire+0x2d18/0x7c40 kernel/locking/lockdep.c:5063 lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5676 down_write+0x36/0x60 kernel/locking/rwsem.c:1573 ocfs2_reflink+0x4cb/0x920 fs/ocfs2/refcounttree.c:4276 ocfs2_vfs_reflink+0x333/0x450 fs/ocfs2/refcounttree.c:4403 ocfs2_reflink_ioctl+0x39c/0x440 fs/ocfs2/refcounttree.c:4443 ocfs2_ioctl+0x584/0x7c0 fs/ocfs2/ioctl.c:913 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Chain exists of: &ocfs2_file_ip_alloc_sem_key --> &journal->j_trans_barrier --> &oi->ip_xattr_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&oi->ip_xattr_sem); lock(&journal->j_trans_barrier); lock(&oi->ip_xattr_sem); lock(&ocfs2_file_ip_alloc_sem_key); *** DEADLOCK *** 4 locks held by syz.8.2218/11249: #0: ffff888056e32460 (sb_writers#19){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:402 #1: ffff8880568f89c8 (&type->i_mutex_dir_key#14/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #1: ffff8880568f89c8 (&type->i_mutex_dir_key#14/1){+.+.}-{3:3}, at: filename_create+0x20b/0x450 fs/namei.c:3884 #2: ffff888077616d88 (&sb->s_type->i_mutex_key#26){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #2: ffff888077616d88 (&sb->s_type->i_mutex_key#26){+.+.}-{3:3}, at: ocfs2_vfs_reflink+0x2f3/0x450 fs/ocfs2/refcounttree.c:4400 #3: ffff888077616ab8 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_reflink+0x4bc/0x920 fs/ocfs2/refcounttree.c:4275 stack backtrace: CPU: 0 PID: 11249 Comm: syz.8.2218 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026 Call Trace: dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106 check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3830 [inline] __lock_acquire+0x2d18/0x7c40 kernel/locking/lockdep.c:5063 lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5676 down_write+0x36/0x60 kernel/locking/rwsem.c:1573 ocfs2_reflink+0x4cb/0x920 fs/ocfs2/refcounttree.c:4276 ocfs2_vfs_reflink+0x333/0x450 fs/ocfs2/refcounttree.c:4403 ocfs2_reflink_ioctl+0x39c/0x440 fs/ocfs2/refcounttree.c:4443 ocfs2_ioctl+0x584/0x7c0 fs/ocfs2/ioctl.c:913 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f4a2399de99 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:00007f4a2486e028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f4a23c25fa0 RCX: 00007f4a2399de99 RDX: 00002000000001c0 RSI: 0000000040186f04 RDI: 0000000000000004 RBP: 00007f4a23a33eaf R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f4a23c26038 R14: 00007f4a23c25fa0 R15: 00007ffe36d33088