====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.2.26/4561 is trying to acquire lock: ffff0000d2e34ae0 (&sdp->sd_quota_mutex){+.+.}-{3:3}, at: do_qc+0xc0/0x658 fs/gfs2/quota.c:682 but task is already holding lock: ffff0000f6ab5d40 (&ip->i_rw_mutex){++++}-{3:3} , at: __gfs2_iomap_alloc+0x200/0x13b8 fs/gfs2/bmap.c:685 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ip->i_rw_mutex){++++}-{3:3}: down_read+0x64/0x300 kernel/locking/rwsem.c:1520 __gfs2_iomap_get+0x118/0x10fc fs/gfs2/bmap.c:862 gfs2_iomap_get+0xd4/0x144 fs/gfs2/bmap.c:1413 bh_get+0x1e8/0x608 fs/gfs2/quota.c:385 qdsb_get+0x1c4/0x370 fs/gfs2/quota.c:522 gfs2_quota_hold+0x16c/0x550 fs/gfs2/quota.c:608 gfs2_quota_lock+0xbc/0x748 fs/gfs2/quota.c:1076 gfs2_quota_lock_check fs/gfs2/quota.h:50 [inline] alloc_dinode+0x138/0x418 fs/gfs2/inode.c:393 gfs2_create_inode+0xa64/0x110c fs/gfs2/inode.c:712 gfs2_atomic_open+0xcc/0x1cc fs/gfs2/inode.c:1292 atomic_open fs/namei.c:3396 [inline] lookup_open fs/namei.c:3504 [inline] open_last_lookups fs/namei.c:3601 [inline] path_openat+0xb1c/0x27a0 fs/namei.c:3835 do_filp_open+0x198/0x38c fs/namei.c:3865 do_sys_openat2+0x134/0x3fc 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] __arm64_sys_openat+0x11c/0x150 fs/open.c:1347 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x12c 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:589 -> #0 (&sdp->sd_quota_mutex ){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3162 [inline] check_prevs_add kernel/locking/lockdep.c:3281 [inline] validate_chain kernel/locking/lockdep.c:3897 [inline] __lock_acquire+0x3504/0x7280 kernel/locking/lockdep.c:5171 lock_acquire+0x210/0x63c kernel/locking/lockdep.c:5790 __mutex_lock_common+0x1a0/0x1f88 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799 do_qc+0xc0/0x658 fs/gfs2/quota.c:682 gfs2_quota_change+0x238/0x718 fs/gfs2/quota.c:1295 gfs2_alloc_blocks+0x1380/0x1aa4 fs/gfs2/rgrp.c:2494 __gfs2_iomap_alloc+0x398/0x13b8 fs/gfs2/bmap.c:711 gfs2_iomap_alloc+0x134/0x1c4 fs/gfs2/bmap.c:1426 fallocate_chunk fs/gfs2/file.c:1192 [inline] __gfs2_fallocate+0xc7c/0x1844 fs/gfs2/file.c:1331 gfs2_fallocate+0x35c/0x4a4 fs/gfs2/file.c:1395 vfs_fallocate+0x4a4/0x5fc fs/open.c:323 ksys_fallocate fs/open.c:346 [inline] __do_sys_fallocate fs/open.c:354 [inline] __se_sys_fallocate fs/open.c:352 [inline] __arm64_sys_fallocate+0xc4/0x114 fs/open.c:352 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x12c 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:589 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ip->i_rw_mutex); lock(&sdp->sd_quota_mutex); lock(&ip->i_rw_mutex); lock(&sdp->sd_quota_mutex); *** DEADLOCK *** 5 locks held by syz.2.26/4561: #0: ffff0000ccb38460 (sb_writers#16){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:3026 [inline] #0: ffff0000ccb38460 (sb_writers#16){.+.+}-{0:0}, at: vfs_fallocate+0x434/0x5fc fs/open.c:322 #1: ffff0000f6ab58a8 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:764 [inline] #1: ffff0000f6ab58a8 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: gfs2_fallocate+0x190/0x4a4 fs/gfs2/file.c:1374 #2: ffff0000ccb38650 (sb_internal#5){.+.+}-{0:0}, at: gfs2_trans_begin+0xa8/0x114 fs/gfs2/trans.c:118 #3: ffff0000d2e35058 (&sdp->sd_log_flush_lock){.+.+}-{3:3}, at: __gfs2_trans_begin+0x50c/0x884 fs/gfs2/trans.c:87 #4: ffff0000f6ab5d40 (&ip->i_rw_mutex){++++}-{3:3}, at: __gfs2_iomap_alloc+0x200/0x13b8 fs/gfs2/bmap.c:685 stack backtrace: CPU: 0 PID: 4561 Comm: syz.2.26 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 dump_backtrace(regs = 0000000000000000 tsk = 0000000000000000) Call trace: dump_backtrace+0x1c4/0x1f0 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+0xf4/0x15c lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 print_circular_bug+0x148/0x1b0 kernel/locking/lockdep.c:2088 check_noncircular+0x290/0x370 kernel/locking/lockdep.c:2215 check_prev_add kernel/locking/lockdep.c:3162 [inline] check_prevs_add kernel/locking/lockdep.c:3281 [inline] validate_chain kernel/locking/lockdep.c:3897 [inline] __lock_acquire+0x3504/0x7280 kernel/locking/lockdep.c:5171 lock_acquire+0x210/0x63c kernel/locking/lockdep.c:5790 __mutex_lock_common+0x1a0/0x1f88 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799 do_qc+0xc0/0x658 fs/gfs2/quota.c:682 gfs2_quota_change+0x238/0x718 fs/gfs2/quota.c:1295 gfs2_alloc_blocks+0x1380/0x1aa4 fs/gfs2/rgrp.c:2494 __gfs2_iomap_alloc+0x398/0x13b8 fs/gfs2/bmap.c:711 gfs2_iomap_alloc+0x134/0x1c4 fs/gfs2/bmap.c:1426 fallocate_chunk fs/gfs2/file.c:1192 [inline] __gfs2_fallocate+0xc7c/0x1844 fs/gfs2/file.c:1331 gfs2_fallocate+0x35c/0x4a4 fs/gfs2/file.c:1395 vfs_fallocate+0x4a4/0x5fc fs/open.c:323 ksys_fallocate fs/open.c:346 [inline] __do_sys_fallocate fs/open.c:354 [inline] __se_sys_fallocate fs/open.c:352 [inline] __arm64_sys_fallocate+0xc4/0x114 fs/open.c:352 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x12c 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:589 kcov: kcov_task_exit: t = ffff0000d942d400, kcov->t = ffff0000d942d400