Title | Replies (including bot) | Last reply |
---|---|---|
[syzbot] [btrfs?] possible deadlock in btrfs_quota_enable (2) | 0 (1) | 2025/05/10 20:51 |
syzbot |
sign-in | mailing list | source | docs |
Title | Replies (including bot) | Last reply |
---|---|---|
[syzbot] [btrfs?] possible deadlock in btrfs_quota_enable (2) | 0 (1) | 2025/05/10 20:51 |
BTRFS info (device loop0): clearing compat-ro feature flag for FREE_SPACE_TREE (0x1) BTRFS info (device loop0): clearing compat-ro feature flag for FREE_SPACE_TREE_VALID (0x2) ====================================================== WARNING: possible circular locking dependency detected 6.15.0-rc6-syzkaller-00085-gc94d59a126cb #0 Not tainted ------------------------------------------------------ syz.0.60/6428 is trying to acquire lock: ffff888059e69918 (&fs_info->qgroup_ioctl_lock){+.+.}-{4:4}, at: btrfs_quota_enable+0x2be/0x1d50 fs/btrfs/qgroup.c:1059 but task is already holding lock: ffff888059e6a4f8 (btrfs_trans_num_extwriters){++++}-{0:0}, at: join_transaction+0x164/0xd70 fs/btrfs/transaction.c:320 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (btrfs_trans_num_extwriters){++++}-{0:0}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 join_transaction+0x1a4/0xd70 fs/btrfs/transaction.c:321 start_transaction+0x6ae/0x1620 fs/btrfs/transaction.c:705 btrfs_rebuild_free_space_tree+0xb1/0x4e0 fs/btrfs/free-space-tree.c:1317 btrfs_start_pre_rw_mount+0xd76/0x1180 fs/btrfs/disk-io.c:3074 open_ctree+0x2075/0x2800 fs/btrfs/disk-io.c:3614 btrfs_fill_super+0x19d/0x2e0 fs/btrfs/super.c:972 btrfs_get_tree_super fs/btrfs/super.c:1897 [inline] btrfs_get_tree+0x107c/0x1620 fs/btrfs/super.c:2092 vfs_get_tree+0x92/0x2b0 fs/super.c:1759 fc_mount+0x1c/0xb0 fs/namespace.c:1289 btrfs_get_tree_subvol fs/btrfs/super.c:2050 [inline] btrfs_get_tree+0x67d/0x1620 fs/btrfs/super.c:2093 vfs_get_tree+0x92/0x2b0 fs/super.c:1759 do_new_mount+0x24a/0xa40 fs/namespace.c:3881 do_mount fs/namespace.c:4221 [inline] __do_sys_mount fs/namespace.c:4432 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4409 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #3 (btrfs_trans_num_writers){++++}-{0:0}: reacquire_held_locks+0x127/0x1d0 kernel/locking/lockdep.c:5383 __lock_release kernel/locking/lockdep.c:5572 [inline] lock_release+0x1b4/0x3e0 kernel/locking/lockdep.c:5887 percpu_up_read include/linux/percpu-rwsem.h:100 [inline] __sb_end_write include/linux/fs.h:1778 [inline] sb_end_intwrite+0x26/0x1c0 include/linux/fs.h:1895 __btrfs_end_transaction+0x248/0x640 fs/btrfs/transaction.c:1075 btrfs_dirty_inode+0x14c/0x190 fs/btrfs/inode.c:6143 inode_update_time fs/inode.c:2076 [inline] touch_atime+0x2f6/0x6d0 fs/inode.c:2149 file_accessed include/linux/fs.h:2599 [inline] btrfs_file_mmap+0xbf/0x120 fs/btrfs/file.c:1938 call_mmap include/linux/fs.h:2243 [inline] mmap_file mm/internal.h:167 [inline] __mmap_new_file_vma mm/vma.c:2353 [inline] __mmap_new_vma mm/vma.c:2417 [inline] __mmap_region mm/vma.c:2519 [inline] mmap_region+0x103b/0x1e50 mm/vma.c:2597 do_mmap+0xc68/0x1100 mm/mmap.c:561 vm_mmap_pgoff+0x31b/0x4c0 mm/util.c:579 ksys_mmap_pgoff+0x51f/0x760 mm/mmap.c:607 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (&mm->mmap_lock){++++}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 down_read_killable+0x50/0x350 kernel/locking/rwsem.c:1547 mmap_read_lock_killable+0x1d/0x70 include/linux/mmap_lock.h:193 get_mmap_lock_carefully mm/memory.c:6355 [inline] lock_mm_and_find_vma+0x2a8/0x300 mm/memory.c:6406 do_user_addr_fault+0x331/0x1390 arch/x86/mm/fault.c:1360 handle_page_fault arch/x86/mm/fault.c:1480 [inline] exc_page_fault+0x68/0x110 arch/x86/mm/fault.c:1538 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 user_access_begin arch/x86/include/asm/uaccess.h:-1 [inline] filldir64+0x299/0x690 fs/readdir.c:366 dir_emit include/linux/fs.h:3861 [inline] kernfs_fop_readdir+0x534/0x870 fs/kernfs/dir.c:1907 iterate_dir+0x5ac/0x770 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:403 [inline] __se_sys_getdents64+0xe4/0x260 fs/readdir.c:389 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&root->kernfs_rwsem){++++}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 down_write+0x96/0x1f0 kernel/locking/rwsem.c:1577 kernfs_add_one+0x41/0x520 fs/kernfs/dir.c:791 kernfs_create_dir_ns+0xde/0x130 fs/kernfs/dir.c:1091 sysfs_create_dir_ns+0x123/0x280 fs/sysfs/dir.c:59 create_dir lib/kobject.c:73 [inline] kobject_add_internal+0x59f/0xb40 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:2616 btrfs_quota_enable+0x278/0x1d50 fs/btrfs/qgroup.c:1030 btrfs_ioctl_quota_ctl+0x183/0x1c0 fs/btrfs/ioctl.c:3676 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xf9/0x170 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&fs_info->qgroup_ioctl_lock){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3166 [inline] check_prevs_add kernel/locking/lockdep.c:3285 [inline] validate_chain+0xb9b/0x2140 kernel/locking/lockdep.c:3909 __lock_acquire+0xaac/0xd20 kernel/locking/lockdep.c:5235 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 __mutex_lock_common kernel/locking/mutex.c:601 [inline] __mutex_lock+0x182/0xe80 kernel/locking/mutex.c:746 btrfs_quota_enable+0x2be/0x1d50 fs/btrfs/qgroup.c:1059 btrfs_ioctl_quota_ctl+0x183/0x1c0 fs/btrfs/ioctl.c:3676 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xf9/0x170 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 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: &fs_info->qgroup_ioctl_lock --> btrfs_trans_num_writers --> btrfs_trans_num_extwriters Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(btrfs_trans_num_extwriters); lock(btrfs_trans_num_writers); lock(btrfs_trans_num_extwriters); lock(&fs_info->qgroup_ioctl_lock); *** DEADLOCK *** 5 locks held by syz.0.60/6428: #0: ffff888054536420 (sb_writers#20){.+.+}-{0:0}, at: mnt_want_write_file+0x60/0x200 fs/namespace.c:600 #1: ffff888059e68bd0 (&fs_info->subvol_sem){+.+.}-{4:4}, at: btrfs_ioctl_quota_ctl+0x178/0x1c0 fs/btrfs/ioctl.c:3675 #2: ffff888054536610 (sb_internal#3){.+.+}-{0:0}, at: btrfs_quota_enable+0x2b1/0x1d50 fs/btrfs/qgroup.c:1057 #3: ffff888059e6a4d0 (btrfs_trans_num_writers){++++}-{0:0}, at: join_transaction+0x164/0xd70 fs/btrfs/transaction.c:320 #4: ffff888059e6a4f8 (btrfs_trans_num_extwriters){++++}-{0:0}, at: join_transaction+0x164/0xd70 fs/btrfs/transaction.c:320 stack backtrace: CPU: 0 UID: 0 PID: 6428 Comm: syz.0.60 Not tainted 6.15.0-rc6-syzkaller-00085-gc94d59a126cb #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: <TASK> dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_circular_bug+0x2ee/0x310 kernel/locking/lockdep.c:2079 check_noncircular+0x134/0x160 kernel/locking/lockdep.c:2211 check_prev_add kernel/locking/lockdep.c:3166 [inline] check_prevs_add kernel/locking/lockdep.c:3285 [inline] validate_chain+0xb9b/0x2140 kernel/locking/lockdep.c:3909 __lock_acquire+0xaac/0xd20 kernel/locking/lockdep.c:5235 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 __mutex_lock_common kernel/locking/mutex.c:601 [inline] __mutex_lock+0x182/0xe80 kernel/locking/mutex.c:746 btrfs_quota_enable+0x2be/0x1d50 fs/btrfs/qgroup.c:1059 btrfs_ioctl_quota_ctl+0x183/0x1c0 fs/btrfs/ioctl.c:3676 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xf9/0x170 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7ffbac18e969 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:00007ffbad070038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007ffbac3b5fa0 RCX: 00007ffbac18e969 RDX: 0000200000000580 RSI: 00000000c0109428 RDI: 0000000000000003 RBP: 00007ffbac210ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007ffbac3b5fa0 R15: 00007fff1c3f8978 </TASK>
Time | Kernel | Commit | Syzkaller | Config | Log | Report | Syz repro | C repro | VM info | Assets (help?) | Manager | Title |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2025/05/15 04:44 | upstream | c94d59a126cb | d6b2ee52 | .config | console log | report | info | [disk image] [vmlinux] [kernel image] | ci2-upstream-fs | possible deadlock in btrfs_quota_enable | ||
2025/05/06 20:39 | upstream | 0d8d44db295c | 350f4ffc | .config | console log | report | info | [disk image] [vmlinux] [kernel image] | ci2-upstream-fs | possible deadlock in btrfs_quota_enable |