loop2: detected capacity change from 0 to 32768 ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Tainted: G L ------------------------------------------------------ syz.2.1412/13324 is trying to acquire lock: ffff888026827b20 (&type->i_mutex_dir_key#5){++++}-{4:4}, at: inode_lock_shared include/linux/fs.h:1044 [inline] ffff888026827b20 (&type->i_mutex_dir_key#5){++++}-{4:4}, at: lookup_slow+0x46/0x70 fs/namei.c:1931 but task is already holding lock: ffff88806b7200d0 (&fs_devs->device_list_mutex){+.+.}-{4:4}, at: device_list_add+0x487/0x2280 fs/btrfs/volumes.c:843 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #7 (&fs_devs->device_list_mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:632 [inline] __mutex_lock+0x19e/0x1420 kernel/locking/mutex.c:794 btrfs_run_dev_stats+0x3fe/0x12f0 fs/btrfs/volumes.c:8284 commit_cowonly_roots+0x1b8/0x860 fs/btrfs/transaction.c:1377 btrfs_commit_transaction+0x105a/0x3130 fs/btrfs/transaction.c:2510 btrfs_rebuild_free_space_tree+0x291/0x6e0 fs/btrfs/free-space-tree.c:1380 btrfs_start_pre_rw_mount+0x1529/0x1f20 fs/btrfs/disk-io.c:3057 open_ctree+0x2e04/0x4220 fs/btrfs/disk-io.c:3654 btrfs_fill_super fs/btrfs/super.c:981 [inline] btrfs_get_tree_super fs/btrfs/super.c:1944 [inline] btrfs_get_tree_subvol fs/btrfs/super.c:2087 [inline] btrfs_get_tree+0x1061/0x1910 fs/btrfs/super.c:2121 vfs_get_tree+0x92/0x2a0 fs/super.c:1754 fc_mount fs/namespace.c:1193 [inline] do_new_mount_fc fs/namespace.c:3758 [inline] do_new_mount+0x341/0xd30 fs/namespace.c:3834 do_mount fs/namespace.c:4167 [inline] __do_sys_mount fs/namespace.c:4399 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4376 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #6 (&fs_info->reloc_mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:632 [inline] __mutex_lock+0x19e/0x1420 kernel/locking/mutex.c:794 btrfs_commit_transaction+0xf6b/0x3130 fs/btrfs/transaction.c:2456 btrfs_rebuild_free_space_tree+0x291/0x6e0 fs/btrfs/free-space-tree.c:1380 btrfs_start_pre_rw_mount+0x1529/0x1f20 fs/btrfs/disk-io.c:3057 open_ctree+0x2e04/0x4220 fs/btrfs/disk-io.c:3654 btrfs_fill_super fs/btrfs/super.c:981 [inline] btrfs_get_tree_super fs/btrfs/super.c:1944 [inline] btrfs_get_tree_subvol fs/btrfs/super.c:2087 [inline] btrfs_get_tree+0x1061/0x1910 fs/btrfs/super.c:2121 vfs_get_tree+0x92/0x2a0 fs/super.c:1754 fc_mount fs/namespace.c:1193 [inline] do_new_mount_fc fs/namespace.c:3758 [inline] do_new_mount+0x341/0xd30 fs/namespace.c:3834 do_mount fs/namespace.c:4167 [inline] __do_sys_mount fs/namespace.c:4399 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4376 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #5 (btrfs_trans_unblocked){++++}-{0:0}: wait_current_trans+0x269/0x590 fs/btrfs/transaction.c:535 start_transaction+0xaf1/0x1790 fs/btrfs/transaction.c:716 btrfs_ioctl_qgroup_limit+0x10d/0x230 fs/btrfs/ioctl.c:3747 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #4 (sb_internal#2){.+.+}-{0:0}: 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/super.h:19 [inline] sb_start_intwrite include/linux/fs/super.h:177 [inline] start_transaction+0x9c2/0x1790 fs/btrfs/transaction.c:713 btrfs_dirty_inode+0x9f/0x190 fs/btrfs/inode.c:6437 file_update_time_flags+0x2cf/0x4a0 fs/inode.c:2420 btrfs_page_mkwrite+0x60a/0x1a60 fs/btrfs/file.c:1914 do_page_mkwrite+0x14d/0x310 mm/memory.c:3668 wp_page_shared mm/memory.c:4069 [inline] do_wp_page+0x19ba/0x4cc0 mm/memory.c:4288 handle_pte_fault mm/memory.c:6470 [inline] __handle_mm_fault mm/memory.c:6592 [inline] handle_mm_fault+0x151d/0x3170 mm/memory.c:6761 do_user_addr_fault+0xa73/0x1340 arch/x86/mm/fault.c:1334 handle_page_fault arch/x86/mm/fault.c:1474 [inline] exc_page_fault+0x6a/0xc0 arch/x86/mm/fault.c:1527 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:618 -> #3 (sb_pagefaults#6){.+.+}-{0:0}: 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/super.h:19 [inline] sb_start_pagefault include/linux/fs/super.h:159 [inline] btrfs_page_mkwrite+0x351/0x1a60 fs/btrfs/file.c:1873 do_page_mkwrite+0x14d/0x310 mm/memory.c:3668 wp_page_shared mm/memory.c:4069 [inline] do_wp_page+0x19ba/0x4cc0 mm/memory.c:4288 handle_pte_fault mm/memory.c:6470 [inline] __handle_mm_fault mm/memory.c:6592 [inline] handle_mm_fault+0x151d/0x3170 mm/memory.c:6761 do_user_addr_fault+0xa73/0x1340 arch/x86/mm/fault.c:1334 handle_page_fault arch/x86/mm/fault.c:1474 [inline] exc_page_fault+0x6a/0xc0 arch/x86/mm/fault.c:1527 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:618 -> #2 (vm_lock){++++}-{0:0}: __vma_start_exclude_readers+0x28a/0x940 mm/mmap_lock.c:125 __vma_start_write+0xdc/0x290 mm/mmap_lock.c:148 vma_start_write include/linux/mmap_lock.h:303 [inline] mprotect_fixup+0x785/0xb60 mm/mprotect.c:787 setup_arg_pages+0x664/0xbd0 fs/exec.c:670 load_elf_binary+0xc5e/0x2980 fs/binfmt_elf.c:1028 search_binary_handler fs/exec.c:1664 [inline] exec_binprm fs/exec.c:1696 [inline] bprm_execve+0x956/0x1450 fs/exec.c:1748 kernel_execve+0x844/0x930 fs/exec.c:1892 try_to_run_init_process+0x13/0x60 init/main.c:1519 kernel_init+0xad/0x1d0 init/main.c:1647 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #1 (&mm->mmap_lock){++++}-{4:4}: down_read_killable+0x50/0x340 kernel/locking/rwsem.c:1593 mmap_read_lock_killable+0x1d/0x70 include/linux/mmap_lock.h:601 get_mmap_lock_carefully mm/mmap_lock.c:450 [inline] lock_mm_and_find_vma+0x2d7/0x340 mm/mmap_lock.c:501 do_user_addr_fault+0x330/0x1340 arch/x86/mm/fault.c:1357 handle_page_fault arch/x86/mm/fault.c:1474 [inline] exc_page_fault+0x6a/0xc0 arch/x86/mm/fault.c:1527 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:618 filldir64+0x2b2/0x640 fs/readdir.c:368 dir_emit include/linux/fs.h:3572 [inline] offset_dir_emit fs/libfs.c:499 [inline] offset_iterate_dir fs/libfs.c:515 [inline] offset_readdir+0x3fc/0x530 fs/libfs.c:564 iterate_dir+0x399/0x570 fs/readdir.c:110 __do_sys_getdents64 fs/readdir.c:399 [inline] __se_sys_getdents64+0xf1/0x280 fs/readdir.c:384 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&type->i_mutex_dir_key#5){++++}-{4:4}: check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x15a5/0x2cf0 kernel/locking/lockdep.c:5237 lock_acquire+0x106/0x350 kernel/locking/lockdep.c:5868 down_read+0x47/0x2e0 kernel/locking/rwsem.c:1568 inode_lock_shared include/linux/fs.h:1044 [inline] lookup_slow+0x46/0x70 fs/namei.c:1931 walk_component fs/namei.c:2278 [inline] lookup_last fs/namei.c:2785 [inline] path_lookupat+0x3f5/0x8c0 fs/namei.c:2809 filename_lookup+0x256/0x5d0 fs/namei.c:2838 kern_path+0x3d/0x150 fs/namei.c:3044 is_same_device fs/btrfs/volumes.c:764 [inline] device_list_add+0xfd1/0x2280 fs/btrfs/volumes.c:898 btrfs_scan_one_device+0x3ef/0x680 fs/btrfs/volumes.c:1499 btrfs_get_tree_super fs/btrfs/super.c:1858 [inline] btrfs_get_tree_subvol fs/btrfs/super.c:2087 [inline] btrfs_get_tree+0x4ab/0x1910 fs/btrfs/super.c:2121 vfs_get_tree+0x92/0x2a0 fs/super.c:1754 fc_mount fs/namespace.c:1193 [inline] do_new_mount_fc fs/namespace.c:3758 [inline] do_new_mount+0x341/0xd30 fs/namespace.c:3834 do_mount fs/namespace.c:4167 [inline] __do_sys_mount fs/namespace.c:4399 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4376 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0xf80 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: &type->i_mutex_dir_key#5 --> &fs_info->reloc_mutex --> &fs_devs->device_list_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&fs_devs->device_list_mutex); lock(&fs_info->reloc_mutex); lock(&fs_devs->device_list_mutex); rlock(&type->i_mutex_dir_key#5); *** DEADLOCK *** 2 locks held by syz.2.1412/13324: #0: ffffffff8ef7f800 (uuid_mutex){+.+.}-{4:4}, at: btrfs_get_tree_super fs/btrfs/super.c:1852 [inline] #0: ffffffff8ef7f800 (uuid_mutex){+.+.}-{4:4}, at: btrfs_get_tree_subvol fs/btrfs/super.c:2087 [inline] #0: ffffffff8ef7f800 (uuid_mutex){+.+.}-{4:4}, at: btrfs_get_tree+0x47c/0x1910 fs/btrfs/super.c:2121 #1: ffff88806b7200d0 (&fs_devs->device_list_mutex){+.+.}-{4:4}, at: device_list_add+0x487/0x2280 fs/btrfs/volumes.c:843 stack backtrace: CPU: 1 UID: 0 PID: 13324 Comm: syz.2.1412 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/18/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_circular_bug+0x2e1/0x300 kernel/locking/lockdep.c:2043 check_noncircular+0x12e/0x150 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 kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x15a5/0x2cf0 kernel/locking/lockdep.c:5237 lock_acquire+0x106/0x350 kernel/locking/lockdep.c:5868 down_read+0x47/0x2e0 kernel/locking/rwsem.c:1568 inode_lock_shared include/linux/fs.h:1044 [inline] lookup_slow+0x46/0x70 fs/namei.c:1931 walk_component fs/namei.c:2278 [inline] lookup_last fs/namei.c:2785 [inline] path_lookupat+0x3f5/0x8c0 fs/namei.c:2809 filename_lookup+0x256/0x5d0 fs/namei.c:2838 kern_path+0x3d/0x150 fs/namei.c:3044 is_same_device fs/btrfs/volumes.c:764 [inline] device_list_add+0xfd1/0x2280 fs/btrfs/volumes.c:898 btrfs_scan_one_device+0x3ef/0x680 fs/btrfs/volumes.c:1499 btrfs_get_tree_super fs/btrfs/super.c:1858 [inline] btrfs_get_tree_subvol fs/btrfs/super.c:2087 [inline] btrfs_get_tree+0x4ab/0x1910 fs/btrfs/super.c:2121 vfs_get_tree+0x92/0x2a0 fs/super.c:1754 fc_mount fs/namespace.c:1193 [inline] do_new_mount_fc fs/namespace.c:3758 [inline] do_new_mount+0x341/0xd30 fs/namespace.c:3834 do_mount fs/namespace.c:4167 [inline] __do_sys_mount fs/namespace.c:4399 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4376 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fa605d9da8a Code: 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fa606ccae58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fa606ccaee0 RCX: 00007fa605d9da8a RDX: 0000200000000000 RSI: 00002000000015c0 RDI: 00007fa606ccaea0 RBP: 0000200000000000 R08: 00007fa606ccaee0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00002000000015c0 R13: 00007fa606ccaea0 R14: 000000000000559e R15: 0000200000000440