====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.2.162/4987 is trying to acquire lock: ffff0000db90cae0 (&sdp->sd_quota_mutex){+.+.}-{3:3}, at: do_qc+0xb8/0x648 fs/gfs2/quota.c:682 but task is already holding lock: ffff0000f6c67820 (&ip->i_rw_mutex){++++}-{3:3}, at: __gfs2_iomap_alloc+0x1e8/0x13e0 fs/gfs2/bmap.c:679 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 gfs2_quota_lock+0xbc/0x748 fs/gfs2/quota.c:1076 gfs2_quota_lock_check fs/gfs2/quota.h:50 [inline] ea_alloc_skeleton+0x184/0x4b8 fs/gfs2/xattr.c:748 ea_init+0x150/0x1bc fs/gfs2/xattr.c:817 __gfs2_xattr_set+0x4d0/0x984 fs/gfs2/xattr.c:1195 __gfs2_set_acl+0xfc/0x184 fs/gfs2/acl.c:103 gfs2_set_acl+0x408/0x5e0 fs/gfs2/acl.c:142 set_posix_acl fs/posix_acl.c:1160 [inline] posix_acl_xattr_set+0x2f8/0x398 fs/posix_acl.c:1189 __vfs_setxattr+0x388/0x3a4 fs/xattr.c:182 __vfs_setxattr_noperm+0x120/0x564 fs/xattr.c:216 __vfs_setxattr_locked+0x1ec/0x218 fs/xattr.c:277 vfs_setxattr+0x158/0x2ac fs/xattr.c:309 do_setxattr fs/xattr.c:594 [inline] setxattr+0x228/0x28c fs/xattr.c:617 path_setxattr+0x12c/0x25c fs/xattr.c:636 __do_sys_setxattr fs/xattr.c:652 [inline] __se_sys_setxattr fs/xattr.c:648 [inline] __arm64_sys_setxattr+0xbc/0xd8 fs/xattr.c:648 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x138 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 -> #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 gfs2_alloc_blocks+0x13bc/0x1abc fs/gfs2/rgrp.c:2494 __gfs2_iomap_alloc+0x37c/0x13e0 fs/gfs2/bmap.c:705 gfs2_iomap_begin_write fs/gfs2/bmap.c:1047 [inline] gfs2_iomap_begin+0x964/0x12a8 fs/gfs2/bmap.c:1112 iomap_iter+0x5d4/0x10ec fs/iomap/iter.c:91 iomap_file_buffered_write+0x17c/0x680 fs/iomap/buffered-io.c:846 gfs2_file_buffered_write+0x488/0x7e8 fs/gfs2/file.c:1057 gfs2_file_write_iter+0x40c/0xc58 fs/gfs2/file.c:1158 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x5ac/0x7c4 fs/read_write.c:584 ksys_pwrite64 fs/read_write.c:699 [inline] __do_sys_pwrite64 fs/read_write.c:709 [inline] __se_sys_pwrite64 fs/read_write.c:706 [inline] __arm64_sys_pwrite64+0x170/0x200 fs/read_write.c:706 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x138 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.2.162/4987: #0: ffff0000cc448460 (sb_writers#18){.+.+}-{0:0}, at: vfs_write+0x23c/0x7c4 fs/read_write.c:580 #1: ffff0000f6c67388 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff0000f6c67388 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: gfs2_file_write_iter+0x2f8/0xc58 fs/gfs2/file.c:1115 #2: ffff0000cc448650 (sb_internal#4){.+.+}-{0:0}, at: gfs2_trans_begin+0xa8/0x114 fs/gfs2/trans.c:118 #3: ffff0000db90d058 (&sdp->sd_log_flush_lock){++++}-{3:3}, at: __gfs2_trans_begin+0x4f0/0x85c fs/gfs2/trans.c:87 #4: ffff0000f6c67820 (&ip->i_rw_mutex){++++}-{3:3}, at: __gfs2_iomap_alloc+0x1e8/0x13e0 fs/gfs2/bmap.c:679 stack backtrace: CPU: 1 PID: 4987 Comm: syz.2.162 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/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 gfs2_alloc_blocks+0x13bc/0x1abc fs/gfs2/rgrp.c:2494 __gfs2_iomap_alloc+0x37c/0x13e0 fs/gfs2/bmap.c:705 gfs2_iomap_begin_write fs/gfs2/bmap.c:1047 [inline] gfs2_iomap_begin+0x964/0x12a8 fs/gfs2/bmap.c:1112 iomap_iter+0x5d4/0x10ec fs/iomap/iter.c:91 iomap_file_buffered_write+0x17c/0x680 fs/iomap/buffered-io.c:846 gfs2_file_buffered_write+0x488/0x7e8 fs/gfs2/file.c:1057 gfs2_file_write_iter+0x40c/0xc58 fs/gfs2/file.c:1158 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x5ac/0x7c4 fs/read_write.c:584 ksys_pwrite64 fs/read_write.c:699 [inline] __do_sys_pwrite64 fs/read_write.c:709 [inline] __se_sys_pwrite64 fs/read_write.c:706 [inline] __arm64_sys_pwrite64+0x170/0x200 fs/read_write.c:706 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x138 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