====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.3.104/4866 is trying to acquire lock: ffff0000cd1f8ae0 (&sdp->sd_quota_mutex){+.+.}-{3:3}, at: do_qc+0xc0/0x658 fs/gfs2/quota.c:682 but task is already holding lock: ffff0000e11e20c8 (&ip->i_rw_mutex){++++}-{3:3}, at: sweep_bh_for_rgrps fs/gfs2/bmap.c:1529 [inline] ffff0000e11e20c8 (&ip->i_rw_mutex){++++}-{3:3}, at: punch_hole+0x222c/0x3018 fs/gfs2/bmap.c:1854 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 qd_fish fs/gfs2/quota.c:485 [inline] gfs2_quota_sync+0x224/0x4e8 fs/gfs2/quota.c:1320 gfs2_sync_fs+0x50/0xc8 fs/gfs2/super.c:664 sync_filesystem+0xe8/0x218 fs/sync.c:56 generic_shutdown_super+0x74/0x32c fs/super.c:474 kill_block_super+0x78/0xe0 fs/super.c:1470 gfs2_kill_sb+0xc4/0xd8 fs/gfs2/ops_fstype.c:-1 deactivate_locked_super+0xb4/0x128 fs/super.c:332 deactivate_super+0xe4/0x104 fs/super.c:363 cleanup_mnt+0x3a8/0x430 fs/namespace.c:1191 __cleanup_mnt+0x20/0x30 fs/namespace.c:1198 task_work_run+0x1f4/0x280 kernel/task_work.c:203 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x20f8/0x2c84 arch/arm64/kernel/signal.c:1151 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_svc+0x98/0x128 arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 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:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3830 [inline] __lock_acquire+0x2808/0x6634 kernel/locking/lockdep.c:5063 lock_acquire+0x20c/0x638 kernel/locking/lockdep.c:5676 __mutex_lock_common+0x1a0/0x1f3c 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 punch_hole+0x2ac0/0x3018 fs/gfs2/bmap.c:1955 do_shrink+0x4d8/0x7d4 fs/gfs2/bmap.c:2035 gfs2_setattr_size+0x148/0x6b4 fs/gfs2/bmap.c:2159 gfs2_setattr+0x240/0x3cc fs/gfs2/inode.c:2002 notify_change+0xb5c/0xe20 fs/attr.c:499 do_truncate+0x188/0x20c fs/open.c:65 handle_truncate fs/namei.c:3293 [inline] do_open fs/namei.c:3638 [inline] path_openat+0x21c8/0x27a0 fs/namei.c:3791 do_filp_open+0x198/0x38c fs/namei.c:3818 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/0x128 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: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.3.104/4866: #0: ffff0000f91e6460 (sb_writers#20){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:402 #1: ffff0000e11e1c30 (&sb->s_type->i_mutex_key#26){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff0000e11e1c30 (&sb->s_type->i_mutex_key#26){+.+.}-{3:3}, at: do_truncate+0x174/0x20c fs/open.c:63 #2: ffff0000f91e6650 (sb_internal#4){.+.+}-{0:0}, at: gfs2_trans_begin+0xa8/0x114 fs/gfs2/trans.c:118 #3: ffff0000cd1f9058 (&sdp->sd_log_flush_lock){++++}-{3:3}, at: __gfs2_trans_begin+0x50c/0x884 fs/gfs2/trans.c:87 #4: ffff0000e11e20c8 (&ip->i_rw_mutex){++++}-{3:3}, at: sweep_bh_for_rgrps fs/gfs2/bmap.c:1529 [inline] #4: ffff0000e11e20c8 (&ip->i_rw_mutex){++++}-{3:3}, at: punch_hole+0x222c/0x3018 fs/gfs2/bmap.c:1854 stack backtrace: CPU: 1 PID: 4866 Comm: syz.3.104 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026 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:2048 check_noncircular+0x264/0x2f8 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+0x2808/0x6634 kernel/locking/lockdep.c:5063 lock_acquire+0x20c/0x638 kernel/locking/lockdep.c:5676 __mutex_lock_common+0x1a0/0x1f3c 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 punch_hole+0x2ac0/0x3018 fs/gfs2/bmap.c:1955 do_shrink+0x4d8/0x7d4 fs/gfs2/bmap.c:2035 gfs2_setattr_size+0x148/0x6b4 fs/gfs2/bmap.c:2159 gfs2_setattr+0x240/0x3cc fs/gfs2/inode.c:2002 notify_change+0xb5c/0xe20 fs/attr.c:499 do_truncate+0x188/0x20c fs/open.c:65 handle_truncate fs/namei.c:3293 [inline] do_open fs/namei.c:3638 [inline] path_openat+0x21c8/0x27a0 fs/namei.c:3791 do_filp_open+0x198/0x38c fs/namei.c:3818 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/0x128 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:585