====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.5.398/6371 is trying to acquire lock: ffff0001055b8ae0 (&sdp->sd_quota_mutex){+.+.}-{3:3}, at: do_qc+0xbc/0x648 fs/gfs2/quota.c:682 but task is already holding lock: ffff0000fb6b20c8 (&ip->i_rw_mutex){++++}-{3:3}, at: gfs2_unstuff_dinode+0x9c/0xfcc fs/gfs2/bmap.c:163 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+0x114/0x1044 fs/gfs2/bmap.c:862 gfs2_iomap_get+0xd4/0x144 fs/gfs2/bmap.c:1413 bh_get+0x1e4/0x604 fs/gfs2/quota.c:385 qdsb_get+0x1d4/0x378 fs/gfs2/quota.c:522 gfs2_quota_hold+0x16c/0x558 fs/gfs2/quota.c:608 gfs2_quota_lock+0xbc/0x744 fs/gfs2/quota.c:1076 gfs2_quota_lock_check fs/gfs2/quota.h:50 [inline] alloc_dinode+0x138/0x414 fs/gfs2/inode.c:393 gfs2_create_inode+0xa64/0x1114 fs/gfs2/inode.c:712 gfs2_atomic_open+0xc8/0x1c4 fs/gfs2/inode.c:1293 atomic_open fs/namei.c:3353 [inline] lookup_open fs/namei.c:3461 [inline] open_last_lookups fs/namei.c:3558 [inline] path_openat+0xb4c/0x26bc fs/namei.c:3788 do_filp_open+0x194/0x384 fs/namei.c:3818 file_open_name fs/open.c:1265 [inline] filp_open+0x160/0x1cc fs/open.c:1285 do_coredump+0x1570/0x1c68 fs/coredump.c:765 get_signal+0xdec/0x1304 kernel/signal.c:2857 do_signal arch/arm64/kernel/signal.c:1095 [inline] do_notify_resume+0x28c/0x2aa4 arch/arm64/kernel/signal.c:1148 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_da+0xb4/0x144 arch/arm64/kernel/entry-common.c:516 el0t_64_sync_handler+0x90/0xf0 arch/arm64/kernel/entry-common.c:658 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #0 (&sdp->sd_quota_mutex){+.+.}-{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+0x2880/0x6800 kernel/locking/lockdep.c:5049 lock_acquire+0x20c/0x63c kernel/locking/lockdep.c:5662 __mutex_lock_common+0x190/0x1f60 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+0xbc/0x648 fs/gfs2/quota.c:682 gfs2_quota_change+0x238/0x718 fs/gfs2/quota.c:1295 gfs2_alloc_blocks+0x13b8/0x1ab8 fs/gfs2/rgrp.c:2494 __gfs2_unstuff_inode fs/gfs2/bmap.c:109 [inline] gfs2_unstuff_dinode+0x1ac/0xfcc fs/gfs2/bmap.c:168 gfs2_iomap_begin_write fs/gfs2/bmap.c:1042 [inline] gfs2_iomap_begin+0x960/0x13e4 fs/gfs2/bmap.c:1118 iomap_iter+0x5d4/0x10e0 fs/iomap/iter.c:91 iomap_file_buffered_write+0x19c/0x6b8 fs/iomap/buffered-io.c:846 gfs2_file_buffered_write+0x488/0x7e8 fs/gfs2/file.c:1057 gfs2_file_write_iter+0x3f0/0xc1c fs/gfs2/file.c:1158 __kernel_write_iter+0x208/0x56c fs/read_write.c:517 __kernel_write+0xe8/0x148 fs/read_write.c:537 __dump_emit fs/coredump.c:873 [inline] dump_emit+0x224/0x324 fs/coredump.c:910 elf_core_dump+0x230c/0x2da0 fs/binfmt_elf.c:2333 do_coredump+0x10cc/0x1c68 fs/coredump.c:824 get_signal+0xdec/0x1304 kernel/signal.c:2857 do_signal arch/arm64/kernel/signal.c:1095 [inline] do_notify_resume+0x28c/0x2aa4 arch/arm64/kernel/signal.c:1148 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_da+0xb4/0x144 arch/arm64/kernel/entry-common.c:516 el0t_64_sync_handler+0x90/0xf0 arch/arm64/kernel/entry-common.c:658 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 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.5.398/6371: #0: ffff000105578460 (sb_writers#34){.+.+}-{0:0}, at: do_coredump+0x10a8/0x1c68 fs/coredump.c:823 #1: ffff0000fb6b1c30 (&sb->s_type->i_mutex_key#45){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff0000fb6b1c30 (&sb->s_type->i_mutex_key#45){+.+.}-{3:3}, at: gfs2_file_write_iter+0x2cc/0xc1c fs/gfs2/file.c:1115 #2: ffff000105578650 (sb_internal#6){.+.+}-{0:0}, at: gfs2_trans_begin+0xa8/0x114 fs/gfs2/trans.c:118 #3: ffff0001055b9058 (&sdp->sd_log_flush_lock){++++}-{3:3}, at: __gfs2_trans_begin+0x500/0x870 fs/gfs2/trans.c:87 #4: ffff0000fb6b20c8 (&ip->i_rw_mutex){++++}-{3:3}, at: gfs2_unstuff_dinode+0x9c/0xfcc fs/gfs2/bmap.c:163 stack backtrace: CPU: 1 PID: 6371 Comm: syz.5.398 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/26/2026 Call trace: dump_backtrace+0x1c0/0x1ec 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:2048 check_noncircular+0x264/0x2f8 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+0x2880/0x6800 kernel/locking/lockdep.c:5049 lock_acquire+0x20c/0x63c kernel/locking/lockdep.c:5662 __mutex_lock_common+0x190/0x1f60 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+0xbc/0x648 fs/gfs2/quota.c:682 gfs2_quota_change+0x238/0x718 fs/gfs2/quota.c:1295 gfs2_alloc_blocks+0x13b8/0x1ab8 fs/gfs2/rgrp.c:2494 __gfs2_unstuff_inode fs/gfs2/bmap.c:109 [inline] gfs2_unstuff_dinode+0x1ac/0xfcc fs/gfs2/bmap.c:168 gfs2_iomap_begin_write fs/gfs2/bmap.c:1042 [inline] gfs2_iomap_begin+0x960/0x13e4 fs/gfs2/bmap.c:1118 iomap_iter+0x5d4/0x10e0 fs/iomap/iter.c:91 iomap_file_buffered_write+0x19c/0x6b8 fs/iomap/buffered-io.c:846 gfs2_file_buffered_write+0x488/0x7e8 fs/gfs2/file.c:1057 gfs2_file_write_iter+0x3f0/0xc1c fs/gfs2/file.c:1158 __kernel_write_iter+0x208/0x56c fs/read_write.c:517 __kernel_write+0xe8/0x148 fs/read_write.c:537 __dump_emit fs/coredump.c:873 [inline] dump_emit+0x224/0x324 fs/coredump.c:910 elf_core_dump+0x230c/0x2da0 fs/binfmt_elf.c:2333 do_coredump+0x10cc/0x1c68 fs/coredump.c:824 get_signal+0xdec/0x1304 kernel/signal.c:2857 do_signal arch/arm64/kernel/signal.c:1095 [inline] do_notify_resume+0x28c/0x2aa4 arch/arm64/kernel/signal.c:1148 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_da+0xb4/0x144 arch/arm64/kernel/entry-common.c:516 el0t_64_sync_handler+0x90/0xf0 arch/arm64/kernel/entry-common.c:658 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585