BTRFS info (device loop8): force clearing of disk cache BTRFS info (device loop8): use zstd compression, level 3 ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.8.601/11635 is trying to acquire lock: ffff8880315aa600 (sb_pagefaults#2){.+.+}-{0:0}, at: do_page_mkwrite+0x14d/0x310 mm/memory.c:3361 but task is already holding lock: ffff88801988c238 (&root->kernfs_rwsem){++++}-{4:4}, at: kernfs_fop_readdir+0x267/0x870 fs/kernfs/dir.c:1893 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (&root->kernfs_rwsem){++++}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868 down_write+0x3a/0x50 kernel/locking/rwsem.c:1590 kernfs_add_one+0x41/0x520 fs/kernfs/dir.c:791 kernfs_create_dir_ns+0xde/0x130 fs/kernfs/dir.c:1093 sysfs_create_dir_ns+0x123/0x280 fs/sysfs/dir.c:59 create_dir lib/kobject.c:73 [inline] kobject_add_internal+0x5a5/0xb50 lib/kobject.c:240 kobject_add_varg lib/kobject.c:374 [inline] kobject_init_and_add+0x125/0x190 lib/kobject.c:457 btrfs_sysfs_add_qgroups+0x111/0x2b0 fs/btrfs/sysfs.c:2641 btrfs_quota_enable+0x253/0x2600 fs/btrfs/qgroup.c:1022 btrfs_ioctl_quota_ctl+0x186/0x1c0 fs/btrfs/ioctl.c:3667 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:598 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #3 (&fs_info->qgroup_ioctl_lock){+.+.}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868 __mutex_lock_common kernel/locking/rtmutex_api.c:535 [inline] mutex_lock_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:547 btrfs_quota_enable+0x28e/0x2600 fs/btrfs/qgroup.c:1051 btrfs_ioctl_quota_ctl+0x186/0x1c0 fs/btrfs/ioctl.c:3667 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:598 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (btrfs_trans_num_extwriters){++++}-{0:0}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868 join_transaction+0x1a4/0xca0 fs/btrfs/transaction.c:321 start_transaction+0x6b6/0x1620 fs/btrfs/transaction.c:705 btrfs_quota_enable+0x281/0x2600 fs/btrfs/qgroup.c:1049 btrfs_ioctl_quota_ctl+0x186/0x1c0 fs/btrfs/ioctl.c:3667 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:598 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (btrfs_trans_num_writers){++++}-{0:0}: reacquire_held_locks+0x127/0x1d0 kernel/locking/lockdep.c:5385 __lock_release kernel/locking/lockdep.c:5574 [inline] lock_release+0x1b4/0x3e0 kernel/locking/lockdep.c:5889 percpu_up_read include/linux/percpu-rwsem.h:112 [inline] __sb_end_write include/linux/fs.h:1793 [inline] sb_end_intwrite+0x26/0x1c0 include/linux/fs.h:1910 __btrfs_end_transaction+0x248/0x640 fs/btrfs/transaction.c:1076 btrfs_dirty_inode+0x14c/0x190 fs/btrfs/inode.c:6249 inode_update_time fs/inode.c:2075 [inline] __file_update_time fs/inode.c:2304 [inline] file_update_time+0x34a/0x490 fs/inode.c:2334 btrfs_page_mkwrite+0x5dd/0x1a80 fs/btrfs/file.c:1916 do_page_mkwrite+0x14d/0x310 mm/memory.c:3361 do_shared_fault mm/memory.c:5649 [inline] do_fault mm/memory.c:5711 [inline] do_pte_missing mm/memory.c:4234 [inline] handle_pte_fault mm/memory.c:6052 [inline] __handle_mm_fault mm/memory.c:6195 [inline] handle_mm_fault+0x124b/0x3400 mm/memory.c:6364 do_user_addr_fault+0x764/0x1390 arch/x86/mm/fault.c:1387 handle_page_fault arch/x86/mm/fault.c:1476 [inline] exc_page_fault+0x76/0xf0 arch/x86/mm/fault.c:1532 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 -> #0 (sb_pagefaults#2){.+.+}-{0:0}: check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain+0xb9b/0x2140 kernel/locking/lockdep.c:3908 __lock_acquire+0xab9/0xd20 kernel/locking/lockdep.c:5237 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868 percpu_down_read_internal include/linux/percpu-rwsem.h:53 [inline] percpu_down_read_freezable include/linux/percpu-rwsem.h:83 [inline] __sb_start_write include/linux/fs.h:1798 [inline] sb_start_pagefault include/linux/fs.h:1963 [inline] btrfs_page_mkwrite+0x32c/0x1a80 fs/btrfs/file.c:1875 do_page_mkwrite+0x14d/0x310 mm/memory.c:3361 wp_page_shared mm/memory.c:3762 [inline] do_wp_page+0x25b8/0x4910 mm/memory.c:3981 handle_pte_fault mm/memory.c:6068 [inline] __handle_mm_fault mm/memory.c:6195 [inline] handle_mm_fault+0x97c/0x3400 mm/memory.c:6364 do_user_addr_fault+0x764/0x1390 arch/x86/mm/fault.c:1387 handle_page_fault arch/x86/mm/fault.c:1476 [inline] exc_page_fault+0x76/0xf0 arch/x86/mm/fault.c:1532 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 filldir64+0x2c7/0x690 fs/readdir.c:-1 dir_emit include/linux/fs.h:3958 [inline] kernfs_fop_readdir+0x53a/0x870 fs/kernfs/dir.c:1910 iterate_dir+0x3a2/0x580 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:410 [inline] __se_sys_getdents64+0xe4/0x260 fs/readdir.c:396 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: sb_pagefaults#2 --> &fs_info->qgroup_ioctl_lock --> &root->kernfs_rwsem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(&root->kernfs_rwsem); lock(&fs_info->qgroup_ioctl_lock); lock(&root->kernfs_rwsem); rlock(sb_pagefaults#2); *** DEADLOCK *** 4 locks held by syz.8.601/11635: #0: ffff8880359d0d28 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x253/0x320 fs/file.c:1232 #1: ffff888061863ea8 (&type->i_mutex_dir_key#4){++++}-{4:4}, at: iterate_dir+0x29e/0x580 fs/readdir.c:101 #2: ffff88801988c238 (&root->kernfs_rwsem){++++}-{4:4}, at: kernfs_fop_readdir+0x267/0x870 fs/kernfs/dir.c:1893 #3: ffff88803de418d0 (&mm->mmap_lock){++++}-{4:4}, at: mmap_read_trylock include/linux/mmap_lock.h:472 [inline] #3: ffff88803de418d0 (&mm->mmap_lock){++++}-{4:4}, at: get_mmap_lock_carefully mm/mmap_lock.c:277 [inline] #3: ffff88803de418d0 (&mm->mmap_lock){++++}-{4:4}, at: lock_mm_and_find_vma+0x32/0x300 mm/mmap_lock.c:337 stack backtrace: CPU: 0 UID: 0 PID: 11635 Comm: syz.8.601 Not tainted syzkaller #0 PREEMPT_{RT,(full)} Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_circular_bug+0x2ee/0x310 kernel/locking/lockdep.c:2043 check_noncircular+0x134/0x160 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain+0xb9b/0x2140 kernel/locking/lockdep.c:3908 __lock_acquire+0xab9/0xd20 kernel/locking/lockdep.c:5237 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868 percpu_down_read_internal include/linux/percpu-rwsem.h:53 [inline] percpu_down_read_freezable include/linux/percpu-rwsem.h:83 [inline] __sb_start_write include/linux/fs.h:1798 [inline] sb_start_pagefault include/linux/fs.h:1963 [inline] btrfs_page_mkwrite+0x32c/0x1a80 fs/btrfs/file.c:1875 do_page_mkwrite+0x14d/0x310 mm/memory.c:3361 wp_page_shared mm/memory.c:3762 [inline] do_wp_page+0x25b8/0x4910 mm/memory.c:3981 handle_pte_fault mm/memory.c:6068 [inline] __handle_mm_fault mm/memory.c:6195 [inline] handle_mm_fault+0x97c/0x3400 mm/memory.c:6364 do_user_addr_fault+0x764/0x1390 arch/x86/mm/fault.c:1387 handle_page_fault arch/x86/mm/fault.c:1476 [inline] exc_page_fault+0x76/0xf0 arch/x86/mm/fault.c:1532 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 RIP: 0010:filldir64+0x2c7/0x690 fs/readdir.c:379 Code: e8 48 8b 44 24 50 49 89 44 24 08 48 8b 4c 24 08 48 8b 44 24 58 48 89 01 48 8b 04 24 8b 54 24 14 49 bc 00 00 00 00 00 fc ff df <66> 89 41 10 80 e2 0f 88 51 12 49 63 ee c6 44 29 13 00 4c 8d 79 13 RSP: 0018:ffffc90010037c58 EFLAGS: 00050283 RAX: 0000000000000020 RBX: ffffc90010037e38 RCX: 0000200000000ff0 RDX: 0000000000000004 RSI: 0000200000000fd0 RDI: 0000200000001010 RBP: 00007ffffffff000 R08: 0000000000000000 R09: 0000000000000000 R10: dffffc0000000000 R11: ffffed1004c4c001 R12: dffffc0000000000 R13: ffffffff8b79a4c0 R14: 0000000000000005 R15: 0000200000001010 dir_emit include/linux/fs.h:3958 [inline] kernfs_fop_readdir+0x53a/0x870 fs/kernfs/dir.c:1910 iterate_dir+0x3a2/0x580 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:410 [inline] __se_sys_getdents64+0xe4/0x260 fs/readdir.c:396 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f9e1304ebe9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f9e112ae038 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007f9e13275fa0 RCX: 00007f9e1304ebe9 RDX: 0000000000000ff6 RSI: 0000200000000f80 RDI: 0000000000000008 RBP: 00007f9e130d1e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f9e13276038 R14: 00007f9e13275fa0 R15: 00007ffea8a15208 sysfs: Unknown parameter '˙˙˙˙˙˙˙˙˙˙˙˙˙˙18446744073709551615˙˙˙˙š@­LqE:†‹ á艞Őt}˛0ü$‰' ---------------- Code disassembly (best guess): 0: e8 48 8b 44 24 call 0x24448b4d 5: 50 push %rax 6: 49 89 44 24 08 mov %rax,0x8(%r12) b: 48 8b 4c 24 08 mov 0x8(%rsp),%rcx 10: 48 8b 44 24 58 mov 0x58(%rsp),%rax 15: 48 89 01 mov %rax,(%rcx) 18: 48 8b 04 24 mov (%rsp),%rax 1c: 8b 54 24 14 mov 0x14(%rsp),%edx 20: 49 bc 00 00 00 00 00 movabs $0xdffffc0000000000,%r12 27: fc ff df * 2a: 66 89 41 10 mov %ax,0x10(%rcx) <-- trapping instruction 2e: 80 e2 0f and $0xf,%dl 31: 88 51 12 mov %dl,0x12(%rcx) 34: 49 63 ee movslq %r14d,%rbp 37: c6 44 29 13 00 movb $0x0,0x13(%rcx,%rbp,1) 3c: 4c 8d 79 13 lea 0x13(%rcx),%r15