====================================================== WARNING: possible circular locking dependency detected 6.10.0-rc4-syzkaller-00148-g50736169ecc8 #0 Not tainted ------------------------------------------------------ syz-executor.3/7395 is trying to acquire lock: ffff888056a1cae8 (&sdp->sd_quota_mutex){+.+.}-{3:3}, at: do_qc+0xac/0x5e0 fs/gfs2/quota.c:720 but task is already holding lock: ffff888069fa85e8 (&ip->i_rw_mutex){++++}-{3:3}, at: sweep_bh_for_rgrps fs/gfs2/bmap.c:1529 [inline] ffff888069fa85e8 (&ip->i_rw_mutex){++++}-{3:3}, at: punch_hole+0x1b93/0x3770 fs/gfs2/bmap.c:1853 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+0x9a/0x330 kernel/locking/rwsem.c:1526 __gfs2_iomap_get+0x146/0x1850 fs/gfs2/bmap.c:859 gfs2_iomap_get+0xb1/0x1f0 fs/gfs2/bmap.c:1413 bh_get+0x25e/0x6e0 fs/gfs2/quota.c:417 qdsb_get.part.0+0x116/0x3e0 fs/gfs2/quota.c:566 qdsb_get fs/gfs2/quota.c:678 [inline] gfs2_quota_hold+0x2be/0x7d0 fs/gfs2/quota.c:646 punch_hole+0xe37/0x3770 fs/gfs2/bmap.c:1814 do_shrink fs/gfs2/bmap.c:2034 [inline] gfs2_setattr_size+0x416/0x12f0 fs/gfs2/bmap.c:2150 gfs2_setattr+0x54f/0x910 fs/gfs2/inode.c:2025 notify_change+0x742/0x11f0 fs/attr.c:497 do_truncate+0x15c/0x220 fs/open.c:65 vfs_truncate+0x3ef/0x4e0 fs/open.c:111 do_sys_truncate+0x130/0x190 fs/open.c:134 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #0 (&sdp->sd_quota_mutex){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 do_qc+0xac/0x5e0 fs/gfs2/quota.c:720 gfs2_quota_change+0x36a/0x550 fs/gfs2/quota.c:1315 punch_hole+0x28cf/0x3770 fs/gfs2/bmap.c:1954 do_shrink fs/gfs2/bmap.c:2034 [inline] gfs2_setattr_size+0x416/0x12f0 fs/gfs2/bmap.c:2150 gfs2_setattr+0x54f/0x910 fs/gfs2/inode.c:2025 notify_change+0x742/0x11f0 fs/attr.c:497 do_truncate+0x15c/0x220 fs/open.c:65 vfs_truncate+0x3ef/0x4e0 fs/open.c:111 do_sys_truncate+0x130/0x190 fs/open.c:134 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e 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-executor.3/7395: #0: ffff88801261e420 (sb_writers#27){.+.+}-{0:0} , at: vfs_truncate+0xea/0x4e0 fs/open.c:84 #1: ffff888069fa8150 (&sb->s_type->i_mutex_key#32){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:791 [inline] #1: ffff888069fa8150 (&sb->s_type->i_mutex_key#32){+.+.}-{3:3}, at: do_truncate+0x14b/0x220 fs/open.c:63 #2: ffff88801261e610 (sb_internal#5){.+.+}-{0:0}, at: gfs2_trans_begin+0x74/0x100 fs/gfs2/trans.c:118 #3: ffff888056a1d060 (&sdp->sd_log_flush_lock){.+.+}-{3:3}, at: __gfs2_trans_begin+0x533/0xb80 fs/gfs2/trans.c:87 #4: ffff888069fa85e8 (&ip->i_rw_mutex ){++++}-{3:3} , at: sweep_bh_for_rgrps fs/gfs2/bmap.c:1529 [inline] , at: punch_hole+0x1b93/0x3770 fs/gfs2/bmap.c:1853 stack backtrace: CPU: 0 PID: 7395 Comm: syz-executor.3 Not tainted 6.10.0-rc4-syzkaller-00148-g50736169ecc8 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 do_qc+0xac/0x5e0 fs/gfs2/quota.c:720 gfs2_quota_change+0x36a/0x550 fs/gfs2/quota.c:1315 punch_hole+0x28cf/0x3770 fs/gfs2/bmap.c:1954 do_shrink fs/gfs2/bmap.c:2034 [inline] gfs2_setattr_size+0x416/0x12f0 fs/gfs2/bmap.c:2150 gfs2_setattr+0x54f/0x910 fs/gfs2/inode.c:2025 notify_change+0x742/0x11f0 fs/attr.c:497 do_truncate+0x15c/0x220 fs/open.c:65 vfs_truncate+0x3ef/0x4e0 fs/open.c:111 do_sys_truncate+0x130/0x190 fs/open.c:134 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf72ce579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f5ec05ac EFLAGS: 00000292 ORIG_RAX: 000000000000005c RAX: ffffffffffffffda RBX: 0000000020000280 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi