Warning: Permanently added '10.128.1.228' (ED25519) to the list of known hosts. executing program [ 46.549397][ T4017] loop0: detected capacity change from 0 to 32768 [ 46.639998][ T4017] BTRFS: device fsid a6a605fc-d5f1-4e66-8595-3726e2b761d6 devid 1 transid 8 /dev/loop0 scanned by syz-executor354 (4017) [ 46.705185][ T4017] BTRFS info (device loop0): using blake2b (blake2b-256-generic) checksum algorithm [ 46.707552][ T4017] BTRFS info (device loop0): using free space tree [ 46.709378][ T4017] BTRFS info (device loop0): has skinny extents [ 46.725987][ T4017] BTRFS info (device loop0): enabling ssd optimizations executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program [ 54.282237][ T4038] [ 54.282869][ T4038] ====================================================== [ 54.284626][ T4038] WARNING: possible circular locking dependency detected [ 54.286319][ T4038] 5.15.165-syzkaller #0 Not tainted [ 54.287571][ T4038] ------------------------------------------------------ [ 54.289260][ T4038] btrfs-transacti/4038 is trying to acquire lock: [ 54.290800][ T4038] ffff0000ca49e4e0 (&fs_devs->device_list_mutex){+.+.}-{3:3}, at: btrfs_run_dev_stats+0xe4/0xe24 [ 54.293464][ T4038] [ 54.293464][ T4038] but task is already holding lock: [ 54.295222][ T4038] ffff0000da264720 (&fs_info->tree_log_mutex){+.+.}-{3:3}, at: btrfs_commit_transaction+0xe34/0x30f0 [ 54.297894][ T4038] [ 54.297894][ T4038] which lock already depends on the new lock. [ 54.297894][ T4038] [ 54.300398][ T4038] [ 54.300398][ T4038] the existing dependency chain (in reverse order) is: [ 54.302573][ T4038] [ 54.302573][ T4038] -> #4 (&fs_info->tree_log_mutex){+.+.}-{3:3}: [ 54.304670][ T4038] __mutex_lock_common+0x194/0x2154 [ 54.306066][ T4038] mutex_lock_nested+0xa4/0xf8 [ 54.307370][ T4038] btrfs_commit_transaction+0xe34/0x30f0 [ 54.308877][ T4038] transaction_kthread+0x284/0x3f4 [ 54.310237][ T4038] kthread+0x37c/0x45c [ 54.311391][ T4038] ret_from_fork+0x10/0x20 [ 54.312598][ T4038] [ 54.312598][ T4038] -> #3 (&fs_info->reloc_mutex){+.+.}-{3:3}: [ 54.314633][ T4038] __mutex_lock_common+0x194/0x2154 [ 54.316029][ T4038] mutex_lock_nested+0xa4/0xf8 [ 54.317341][ T4038] start_transaction+0x450/0x1480 [ 54.318704][ T4038] btrfs_start_transaction+0x34/0x44 [ 54.320124][ T4038] btrfs_create+0x134/0x56c [ 54.321347][ T4038] path_openat+0xf18/0x26cc [ 54.322572][ T4038] do_filp_open+0x1a8/0x3b4 [ 54.323790][ T4038] do_sys_openat2+0x128/0x3e0 [ 54.325058][ T4038] __arm64_sys_openat+0x1f0/0x240 [ 54.326429][ T4038] invoke_syscall+0x98/0x2b8 [ 54.327686][ T4038] el0_svc_common+0x138/0x258 [ 54.328955][ T4038] do_el0_svc+0x58/0x14c [ 54.330089][ T4038] el0_svc+0x7c/0x1f0 [ 54.331172][ T4038] el0t_64_sync_handler+0x84/0xe4 [ 54.332528][ T4038] el0t_64_sync+0x1a0/0x1a4 [ 54.333810][ T4038] [ 54.333810][ T4038] -> #2 (sb_internal#2){.+.+}-{0:0}: [ 54.335648][ T4038] start_transaction+0x644/0x1480 [ 54.337012][ T4038] btrfs_start_transaction+0x34/0x44 [ 54.338433][ T4038] btrfs_create+0x134/0x56c [ 54.339659][ T4038] path_openat+0xf18/0x26cc [ 54.340885][ T4038] do_filp_open+0x1a8/0x3b4 [ 54.342162][ T4038] do_sys_openat2+0x128/0x3e0 [ 54.343440][ T4038] __arm64_sys_openat+0x1f0/0x240 [ 54.344829][ T4038] invoke_syscall+0x98/0x2b8 [ 54.346072][ T4038] el0_svc_common+0x138/0x258 [ 54.347344][ T4038] do_el0_svc+0x58/0x14c [ 54.348517][ T4038] el0_svc+0x7c/0x1f0 [ 54.349623][ T4038] el0t_64_sync_handler+0x84/0xe4 [ 54.350962][ T4038] el0t_64_sync+0x1a0/0x1a4 [ 54.352189][ T4038] [ 54.352189][ T4038] -> #1 (&type->i_mutex_dir_key#6){++++}-{3:3}: [ 54.354274][ T4038] down_read+0xc0/0x398 [ 54.355435][ T4038] lookup_slow+0x50/0x84 [ 54.356606][ T4038] walk_component+0x394/0x4cc [ 54.357877][ T4038] path_lookupat+0x13c/0x3d0 [ 54.359120][ T4038] filename_lookup+0x1c4/0x4c8 [ 54.360410][ T4038] kern_path+0x4c/0x194 [ 54.361549][ T4038] lookup_bdev+0xc0/0x25c [ 54.362748][ T4038] btrfs_free_stale_devices+0x658/0x9ec [ 54.364233][ T4038] btrfs_forget_devices+0x5c/0x98 [ 54.365601][ T4038] btrfs_control_ioctl+0x12c/0x248 [ 54.366981][ T4038] __arm64_sys_ioctl+0x14c/0x1c8 [ 54.368339][ T4038] invoke_syscall+0x98/0x2b8 [ 54.369587][ T4038] el0_svc_common+0x138/0x258 [ 54.370892][ T4038] do_el0_svc+0x58/0x14c [ 54.372047][ T4038] el0_svc+0x7c/0x1f0 [ 54.373155][ T4038] el0t_64_sync_handler+0x84/0xe4 [ 54.374529][ T4038] el0t_64_sync+0x1a0/0x1a4 [ 54.375752][ T4038] [ 54.375752][ T4038] -> #0 (&fs_devs->device_list_mutex){+.+.}-{3:3}: [ 54.377931][ T4038] __lock_acquire+0x32d4/0x7638 [ 54.379265][ T4038] lock_acquire+0x240/0x77c [ 54.380502][ T4038] __mutex_lock_common+0x194/0x2154 [ 54.381916][ T4038] mutex_lock_nested+0xa4/0xf8 [ 54.383213][ T4038] btrfs_run_dev_stats+0xe4/0xe24 [ 54.384553][ T4038] commit_cowonly_roots+0x17c/0x808 [ 54.385941][ T4038] btrfs_commit_transaction+0xef4/0x30f0 [ 54.387443][ T4038] transaction_kthread+0x284/0x3f4 [ 54.388807][ T4038] kthread+0x37c/0x45c [ 54.389938][ T4038] ret_from_fork+0x10/0x20 [ 54.391157][ T4038] [ 54.391157][ T4038] other info that might help us debug this: [ 54.391157][ T4038] [ 54.393679][ T4038] Chain exists of: [ 54.393679][ T4038] &fs_devs->device_list_mutex --> &fs_info->reloc_mutex --> &fs_info->tree_log_mutex [ 54.393679][ T4038] [ 54.397569][ T4038] Possible unsafe locking scenario: [ 54.397569][ T4038] [ 54.399384][ T4038] CPU0 CPU1 [ 54.400678][ T4038] ---- ---- [ 54.401970][ T4038] lock(&fs_info->tree_log_mutex); [ 54.403235][ T4038] lock(&fs_info->reloc_mutex); [ 54.405054][ T4038] lock(&fs_info->tree_log_mutex); [ 54.406960][ T4038] lock(&fs_devs->device_list_mutex); [ 54.408292][ T4038] [ 54.408292][ T4038] *** DEADLOCK *** [ 54.408292][ T4038] executing program [ 54.410253][ T4038] 3 locks held by btrfs-transacti/4038: [ 54.411613][ T4038] #0: ffff0000da2647b0 (&fs_info->transaction_kthread_mutex){+.+.}-{3:3}, at: transaction_kthread+0xd0/0x3f4 [ 54.414517][ T4038] #1: ffff0000da264c90 (&fs_info->reloc_mutex){+.+.}-{3:3}, at: btrfs_commit_transaction+0xd9c/0x30f0 [ 54.417245][ T4038] #2: ffff0000da264720 (&fs_info->tree_log_mutex){+.+.}-{3:3}, at: btrfs_commit_transaction+0xe34/0x30f0 [ 54.420069][ T4038] [ 54.420069][ T4038] stack backtrace: [ 54.421518][ T4038] CPU: 1 PID: 4038 Comm: btrfs-transacti Not tainted 5.15.165-syzkaller #0 [ 54.423639][ T4038] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 [ 54.426105][ T4038] Call trace: [ 54.426976][ T4038] dump_backtrace+0x0/0x530 [ 54.428106][ T4038] show_stack+0x2c/0x3c [ 54.429113][ T4038] dump_stack_lvl+0x108/0x170 [ 54.430303][ T4038] dump_stack+0x1c/0x58 [ 54.431314][ T4038] print_circular_bug+0x150/0x1b8 [ 54.432551][ T4038] check_noncircular+0x2cc/0x378 [ 54.433767][ T4038] __lock_acquire+0x32d4/0x7638 [ 54.434971][ T4038] lock_acquire+0x240/0x77c [ 54.436074][ T4038] __mutex_lock_common+0x194/0x2154 [ 54.437341][ T4038] mutex_lock_nested+0xa4/0xf8 [ 54.438523][ T4038] btrfs_run_dev_stats+0xe4/0xe24 [ 54.439751][ T4038] commit_cowonly_roots+0x17c/0x808 [ 54.441046][ T4038] btrfs_commit_transaction+0xef4/0x30f0 [ 54.442498][ T4038] transaction_kthread+0x284/0x3f4 [ 54.443761][ T4038] kthread+0x37c/0x45c [ 54.444761][ T4038] ret_from_fork+0x10/0x20 executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program executing program