====================================================== WARNING: possible circular locking dependency detected 6.1.135-syzkaller #0 Not tainted ------------------------------------------------------ syz.0.38/4588 is trying to acquire lock: ffff0000d1444ae0 (&sdp->sd_quota_mutex){+.+.}-{3:3}, at: do_qc+0xb8/0x648 fs/gfs2/quota.c:682 but task is already holding lock: ffff0000e14d05e8 (&ip->i_rw_mutex){++++}-{3:3}, at: sweep_bh_for_rgrps fs/gfs2/bmap.c:1512 [inline] ffff0000e14d05e8 (&ip->i_rw_mutex){++++}-{3:3}, at: punch_hole+0x2058/0x2d40 fs/gfs2/bmap.c:1837 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/0x304 kernel/locking/rwsem.c:1520 __gfs2_iomap_get+0x10c/0x100c fs/gfs2/bmap.c:856 gfs2_iomap_get+0xc0/0x120 fs/gfs2/bmap.c:1396 bh_get+0x1d8/0x5e4 fs/gfs2/quota.c:385 qdsb_get+0x1d4/0x37c fs/gfs2/quota.c:522 gfs2_quota_hold+0x16c/0x558 fs/gfs2/quota.c:608 punch_hole+0xae4/0x2d40 fs/gfs2/bmap.c:1798 gfs2_file_dealloc+0x28/0x38 fs/gfs2/bmap.c:2160 evict_unlinked_inode+0x18c/0x5e4 fs/gfs2/super.c:1398 gfs2_evict_inode+0x544/0xe20 fs/gfs2/super.c:1497 evict+0x3c8/0x810 fs/inode.c:705 iput_final fs/inode.c:1834 [inline] iput+0x764/0x7f4 fs/inode.c:1860 dentry_unlink_inode+0x360/0x438 fs/dcache.c:405 __dentry_kill+0x320/0x598 fs/dcache.c:611 dentry_kill+0xc8/0x248 fs/dcache.c:-1 dput+0x238/0x454 fs/dcache.c:918 __fput+0x480/0x7c0 fs/file_table.c:328 ____fput+0x20/0x30 fs/file_table.c:348 task_work_run+0x1ec/0x270 kernel/task_work.c:203 exit_task_work include/linux/task_work.h:39 [inline] do_exit+0x544/0x19a8 kernel/exit.c:871 do_group_exit+0x194/0x22c kernel/exit.c:1021 get_signal+0x11d0/0x1310 kernel/signal.c:2871 do_signal arch/arm64/kernel/signal.c:1081 [inline] do_notify_resume+0x340/0x2b0c arch/arm64/kernel/signal.c:1134 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/0x138 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:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x293c/0x6544 kernel/locking/lockdep.c:5049 lock_acquire+0x20c/0x644 kernel/locking/lockdep.c:5662 __mutex_lock_common+0x190/0x1f38 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+0xb8/0x648 fs/gfs2/quota.c:682 gfs2_quota_change+0x238/0x718 fs/gfs2/quota.c:1295 punch_hole+0x2874/0x2d40 fs/gfs2/bmap.c:1938 gfs2_file_dealloc+0x28/0x38 fs/gfs2/bmap.c:2160 evict_unlinked_inode+0x18c/0x5e4 fs/gfs2/super.c:1398 gfs2_evict_inode+0x544/0xe20 fs/gfs2/super.c:1497 evict+0x3c8/0x810 fs/inode.c:705 iput_final fs/inode.c:1834 [inline] iput+0x764/0x7f4 fs/inode.c:1860 dentry_unlink_inode+0x360/0x438 fs/dcache.c:405 __dentry_kill+0x320/0x598 fs/dcache.c:611 dentry_kill+0xc8/0x248 fs/dcache.c:-1 dput+0x238/0x454 fs/dcache.c:918 __fput+0x480/0x7c0 fs/file_table.c:328 ____fput+0x20/0x30 fs/file_table.c:348 task_work_run+0x1ec/0x270 kernel/task_work.c:203 exit_task_work include/linux/task_work.h:39 [inline] do_exit+0x544/0x19a8 kernel/exit.c:871 do_group_exit+0x194/0x22c kernel/exit.c:1021 get_signal+0x11d0/0x1310 kernel/signal.c:2871 do_signal arch/arm64/kernel/signal.c:1081 [inline] do_notify_resume+0x340/0x2b0c arch/arm64/kernel/signal.c:1134 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/0x138 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 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 *** 3 locks held by syz.0.38/4588: #0: ffff0000d0df6650 (sb_internal#4){.+.+}-{0:0}, at: gfs2_trans_begin+0xa8/0x114 fs/gfs2/trans.c:118 #1: ffff0000d1445058 (&sdp->sd_log_flush_lock){.+.+}-{3:3}, at: __gfs2_trans_begin+0x4f0/0x85c fs/gfs2/trans.c:87 #2: ffff0000e14d05e8 (&ip->i_rw_mutex){++++}-{3:3}, at: sweep_bh_for_rgrps fs/gfs2/bmap.c:1512 [inline] #2: ffff0000e14d05e8 (&ip->i_rw_mutex){++++}-{3:3}, at: punch_hole+0x2058/0x2d40 fs/gfs2/bmap.c:1837 stack backtrace: CPU: 0 PID: 4588 Comm: syz.0.38 Not tainted 6.1.135-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call trace: dump_backtrace+0x1c8/0x1f4 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+0xf8/0x160 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+0x240/0x2d4 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+0x293c/0x6544 kernel/locking/lockdep.c:5049 lock_acquire+0x20c/0x644 kernel/locking/lockdep.c:5662 __mutex_lock_common+0x190/0x1f38 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+0xb8/0x648 fs/gfs2/quota.c:682 gfs2_quota_change+0x238/0x718 fs/gfs2/quota.c:1295 punch_hole+0x2874/0x2d40 fs/gfs2/bmap.c:1938 gfs2_file_dealloc+0x28/0x38 fs/gfs2/bmap.c:2160 evict_unlinked_inode+0x18c/0x5e4 fs/gfs2/super.c:1398 gfs2_evict_inode+0x544/0xe20 fs/gfs2/super.c:1497 evict+0x3c8/0x810 fs/inode.c:705 iput_final fs/inode.c:1834 [inline] iput+0x764/0x7f4 fs/inode.c:1860 dentry_unlink_inode+0x360/0x438 fs/dcache.c:405 __dentry_kill+0x320/0x598 fs/dcache.c:611 dentry_kill+0xc8/0x248 fs/dcache.c:-1 dput+0x238/0x454 fs/dcache.c:918 __fput+0x480/0x7c0 fs/file_table.c:328 ____fput+0x20/0x30 fs/file_table.c:348 task_work_run+0x1ec/0x270 kernel/task_work.c:203 exit_task_work include/linux/task_work.h:39 [inline] do_exit+0x544/0x19a8 kernel/exit.c:871 do_group_exit+0x194/0x22c kernel/exit.c:1021 get_signal+0x11d0/0x1310 kernel/signal.c:2871 do_signal arch/arm64/kernel/signal.c:1081 [inline] do_notify_resume+0x340/0x2b0c arch/arm64/kernel/signal.c:1134 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/0x138 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