======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.4.341/6646 is trying to acquire lock:
ffff8880430c6a20 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_read_virt_blocks+0x25d/0x970 fs/ocfs2/extent_map.c:984
but task is already holding lock:
ffff88802ba404e8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3a4/0x6f0 fs/ocfs2/journal.c:374
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #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+0xf77/0x25b0 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+0x1181/0x2ee0 fs/namei.c:3788
do_filp_open+0x1f1/0x430 fs/namei.c:3818
do_sys_openat2+0x150/0x4b0 fs/open.c:1320
do_sys_open fs/open.c:1336 [inline]
__do_sys_open fs/open.c:1344 [inline]
__se_sys_open fs/open.c:1340 [inline]
__x64_sys_open+0x11b/0x140 fs/open.c:1340
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#5){.+.+}-{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_write_begin_inline fs/ocfs2/aops.c:1481 [inline]
ocfs2_try_to_write_inline_data fs/ocfs2/aops.c:1584 [inline]
ocfs2_write_begin_nolock+0x209f/0x44f0 fs/ocfs2/aops.c:1670
ocfs2_write_begin+0x1c2/0x320 fs/ocfs2/aops.c:1904
generic_perform_write+0x2fa/0x5c0 mm/filemap.c:3862
__generic_file_write_iter+0x148/0x2a0 mm/filemap.c:3960
ocfs2_file_write_iter+0x1660/0x1f00 fs/ocfs2/file.c:2469
call_write_iter include/linux/fs.h:2265 [inline]
aio_write+0x545/0x780 fs/aio.c:1615
__io_submit_one fs/aio.c:-1 [inline]
io_submit_one+0x6cd/0x1380 fs/aio.c:2034
__do_sys_io_submit fs/aio.c:2093 [inline]
__se_sys_io_submit+0x19d/0x310 fs/aio.c:2063
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:3090 [inline]
check_prevs_add kernel/locking/lockdep.c:3209 [inline]
validate_chain kernel/locking/lockdep.c:3825 [inline]
__lock_acquire+0x2d07/0x7d10 kernel/locking/lockdep.c:5049
lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5662
down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520
ocfs2_read_virt_blocks+0x25d/0x970 fs/ocfs2/extent_map.c:984
ocfs2_read_dir_block fs/ocfs2/dir.c:508 [inline]
ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline]
ocfs2_find_entry+0x3c1/0x2180 fs/ocfs2/dir.c:1091
ocfs2_find_files_on_disk+0x102/0x390 fs/ocfs2/dir.c:1995
ocfs2_lookup_ino_from_name+0x4f/0xf0 fs/ocfs2/dir.c:2017
ocfs2_find_victim_alloc_group+0x1d6/0x9d0 fs/ocfs2/move_extents.c:385
ocfs2_move_extent fs/ocfs2/move_extents.c:656 [inline]
__ocfs2_move_extents_range+0x1cac/0x35d0 fs/ocfs2/move_extents.c:866
ocfs2_move_extents+0x3ad/0x9c0 fs/ocfs2/move_extents.c:938
ocfs2_ioctl_move_extents+0x520/0x6c0 fs/ocfs2/move_extents.c:1064
ocfs2_ioctl+0x31e/0x7c0 fs/ocfs2/ioctl.c:930
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 --> sb_internal#5 --> &journal->j_trans_barrier
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&journal->j_trans_barrier);
lock(sb_internal#5);
lock(&journal->j_trans_barrier);
lock(&ocfs2_file_ip_alloc_sem_key);
*** DEADLOCK ***
9 locks held by syz.4.341/6646:
#0: ffff888059c2e460 (sb_writers#17){.+.+}-{0:0}, at: mnt_want_write_file+0x5c/0x200 fs/namespace.c:446
#1: ffff8880757b09c8 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
#1: ffff8880757b09c8 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: ocfs2_move_extents+0x19e/0x9c0 fs/ocfs2/move_extents.c:916
#2: ffff8880757b0660 (&oi->ip_alloc_sem){++++}-{3:3}, at: ocfs2_move_extents+0x3a0/0x9c0 fs/ocfs2/move_extents.c:936
#3: ffff888071c92648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
#3: ffff888071c92648 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#3){+.+.}-{3:3}, at: ocfs2_reserve_suballoc_bits+0x16d/0x4810 fs/ocfs2/suballoc.c:782
#4: ffff888071c942c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
#4: ffff888071c942c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{3:3}, at: ocfs2_move_extent fs/ocfs2/move_extents.c:638 [inline]
#4: ffff888071c942c8 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{3:3}, at: __ocfs2_move_extents_range+0x137d/0x35d0 fs/ocfs2/move_extents.c:866
#5: ffff888071e9b488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
#5: ffff888071e9b488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}, at: ocfs2_move_extent fs/ocfs2/move_extents.c:646 [inline]
#5: ffff888071e9b488 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{3:3}, at: __ocfs2_move_extents_range+0x1a5f/0x35d0 fs/ocfs2/move_extents.c:866
#6: ffff888059c2e650 (sb_internal#5){.+.+}-{0:0}, at: ocfs2_move_extent fs/ocfs2/move_extents.c:648 [inline]
#6: ffff888059c2e650 (sb_internal#5){.+.+}-{0:0}, at: __ocfs2_move_extents_range+0x1a73/0x35d0 fs/ocfs2/move_extents.c:866
#7: ffff88802ba404e8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3a4/0x6f0 fs/ocfs2/journal.c:374
#8: ffff888059c2c990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x200f/0x2230 fs/jbd2/transaction.c:463
stack backtrace:
CPU: 1 PID: 6646 Comm: syz.4.341 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/24/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:3090 [inline]
check_prevs_add kernel/locking/lockdep.c:3209 [inline]
validate_chain kernel/locking/lockdep.c:3825 [inline]
__lock_acquire+0x2d07/0x7d10 kernel/locking/lockdep.c:5049
lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5662
down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520
ocfs2_read_virt_blocks+0x25d/0x970 fs/ocfs2/extent_map.c:984
ocfs2_read_dir_block fs/ocfs2/dir.c:508 [inline]
ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline]
ocfs2_find_entry+0x3c1/0x2180 fs/ocfs2/dir.c:1091
ocfs2_find_files_on_disk+0x102/0x390 fs/ocfs2/dir.c:1995
ocfs2_lookup_ino_from_name+0x4f/0xf0 fs/ocfs2/dir.c:2017
ocfs2_find_victim_alloc_group+0x1d6/0x9d0 fs/ocfs2/move_extents.c:385
ocfs2_move_extent fs/ocfs2/move_extents.c:656 [inline]
__ocfs2_move_extents_range+0x1cac/0x35d0 fs/ocfs2/move_extents.c:866
ocfs2_move_extents+0x3ad/0x9c0 fs/ocfs2/move_extents.c:938
ocfs2_ioctl_move_extents+0x520/0x6c0 fs/ocfs2/move_extents.c:1064
ocfs2_ioctl+0x31e/0x7c0 fs/ocfs2/ioctl.c:930
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:0x7f1688b9bf79
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:00007f1689a27028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f1688e16090 RCX: 00007f1688b9bf79
RDX: 00002000000000c0 RSI: 0000000040406f06 RDI: 0000000000000005
RBP: 00007f1688c327e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f1688e16128 R14: 00007f1688e16090 R15: 00007ffc4eed7128
------------[ cut here ]------------
kernel BUG at fs/ocfs2/suballoc.c:1349!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 6646 Comm: syz.4.341 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/24/2026
RIP: 0010:ocfs2_block_group_set_bits+0x5c5/0x740 fs/ocfs2/suballoc.c:1349
Code: ff 44 89 e1 80 e1 07 fe c1 38 c1 0f 8c 26 fd ff ff 4c 89 e7 e8 7c 06 86 fe e9 19 fd ff ff e8 c2 1a 35 fe 0f 0b e8 bb 1a 35 fe <0f> 0b 65 44 8b 25 a1 c0 b4 7c 48 c7 c0 30 ce 1f 8e 48 c1 e8 03 48
RSP: 0018:ffffc900040073a0 EFLAGS: 00010246
RAX: ffffffff834d58f5 RBX: 000000000000006c RCX: 0000000000080000
RDX: ffffc90011ad4000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc90004007490 R08: 0000000000000007 R09: 000000000000006c
R10: 00000000fffffffc R11: 0000000000000002 R12: dffffc0000000000
R13: 0000000000000007 R14: ffff88804e618000 R15: 000000000000006b
FS: 00007f1689a276c0(0000) GS:ffff8880b8f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb235629d58 CR3: 00000000641b1000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
ocfs2_move_extent fs/ocfs2/move_extents.c:693 [inline]
__ocfs2_move_extents_range+0x2a0f/0x35d0 fs/ocfs2/move_extents.c:866
ocfs2_move_extents+0x3ad/0x9c0 fs/ocfs2/move_extents.c:938
ocfs2_ioctl_move_extents+0x520/0x6c0 fs/ocfs2/move_extents.c:1064
ocfs2_ioctl+0x31e/0x7c0 fs/ocfs2/ioctl.c:930
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:0x7f1688b9bf79
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:00007f1689a27028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f1688e16090 RCX: 00007f1688b9bf79
RDX: 00002000000000c0 RSI: 0000000040406f06 RDI: 0000000000000005
RBP: 00007f1688c327e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f1688e16128 R14: 00007f1688e16090 R15: 00007ffc4eed7128
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:ocfs2_block_group_set_bits+0x5c5/0x740 fs/ocfs2/suballoc.c:1349
Code: ff 44 89 e1 80 e1 07 fe c1 38 c1 0f 8c 26 fd ff ff 4c 89 e7 e8 7c 06 86 fe e9 19 fd ff ff e8 c2 1a 35 fe 0f 0b e8 bb 1a 35 fe <0f> 0b 65 44 8b 25 a1 c0 b4 7c 48 c7 c0 30 ce 1f 8e 48 c1 e8 03 48
RSP: 0018:ffffc900040073a0 EFLAGS: 00010246
RAX: ffffffff834d58f5 RBX: 000000000000006c RCX: 0000000000080000
RDX: ffffc90011ad4000 RSI: 000000000007ffff RDI: 0000000000080000
RBP: ffffc90004007490 R08: 0000000000000007 R09: 000000000000006c
R10: 00000000fffffffc R11: 0000000000000002 R12: dffffc0000000000
R13: 0000000000000007 R14: ffff88804e618000 R15: 000000000000006b
FS: 00007f1689a276c0(0000) GS:ffff8880b8f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005555712a30a8 CR3: 00000000641b1000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400