Warning: Permanently added '10.128.0.72' (ED25519) to the list of known hosts. executing program [ 47.103661][ T4020] loop0: detected capacity change from 0 to 32768 [ 47.210954][ T4020] BTRFS: device fsid a6a605fc-d5f1-4e66-8595-3726e2b761d6 devid 1 transid 8 /dev/loop0 scanned by syz-executor563 (4020) [ 47.253296][ T4020] BTRFS info (device loop0): using blake2b (blake2b-256-generic) checksum algorithm [ 47.255722][ T4020] BTRFS info (device loop0): using free space tree [ 47.257445][ T4020] BTRFS info (device loop0): has skinny extents [ 47.275732][ T4020] BTRFS info (device loop0): enabling ssd optimizations [ 47.292098][ T4020] [ 47.292777][ T4020] ====================================================== [ 47.294277][ T4020] WARNING: possible circular locking dependency detected [ 47.295534][ T4020] 5.15.175-syzkaller #0 Not tainted [ 47.296506][ T4020] ------------------------------------------------------ [ 47.297801][ T4020] syz-executor563/4020 is trying to acquire lock: [ 47.299116][ T4020] ffff0000e20c8fe0 (&type->i_mutex_dir_key#6){++++}-{3:3}, at: lookup_slow+0x50/0x84 [ 47.301074][ T4020] [ 47.301074][ T4020] but task is already holding lock: [ 47.302501][ T4020] ffff0000da2cc8e0 (&fs_devs->device_list_mutex){+.+.}-{3:3}, at: btrfs_free_stale_devices+0x158/0x9ec [ 47.304829][ T4020] [ 47.304829][ T4020] which lock already depends on the new lock. [ 47.304829][ T4020] [ 47.307064][ T4020] [ 47.307064][ T4020] the existing dependency chain (in reverse order) is: [ 47.308912][ T4020] [ 47.308912][ T4020] -> #3 (&fs_devs->device_list_mutex){+.+.}-{3:3}: [ 47.310662][ T4020] __mutex_lock_common+0x194/0x2154 [ 47.311853][ T4020] mutex_lock_nested+0xa4/0xf8 [ 47.313009][ T4020] write_all_supers+0x134c/0x3a6c [ 47.314107][ T4020] btrfs_sync_log+0x19c8/0x2294 [ 47.315282][ T4020] btrfs_sync_file+0xa70/0xfd4 [ 47.316333][ T4020] __arm64_sys_fdatasync+0xac/0x104 [ 47.317602][ T4020] invoke_syscall+0x98/0x2b8 [ 47.318631][ T4020] el0_svc_common+0x138/0x258 [ 47.319812][ T4020] do_el0_svc+0x58/0x14c [ 47.320883][ T4020] el0_svc+0x7c/0x1f0 [ 47.321951][ T4020] el0t_64_sync_handler+0x84/0xe4 [ 47.323058][ T4020] el0t_64_sync+0x1a0/0x1a4 [ 47.324037][ T4020] [ 47.324037][ T4020] -> #2 (&fs_info->tree_log_mutex){+.+.}-{3:3}: [ 47.326000][ T4020] __mutex_lock_common+0x194/0x2154 [ 47.327039][ T4020] mutex_lock_nested+0xa4/0xf8 [ 47.328183][ T4020] btrfs_sync_log+0x1904/0x2294 [ 47.329290][ T4020] btrfs_sync_file+0xa70/0xfd4 [ 47.330394][ T4020] __arm64_sys_fdatasync+0xac/0x104 [ 47.331585][ T4020] invoke_syscall+0x98/0x2b8 [ 47.332650][ T4020] el0_svc_common+0x138/0x258 [ 47.333780][ T4020] do_el0_svc+0x58/0x14c [ 47.334786][ T4020] el0_svc+0x7c/0x1f0 [ 47.335754][ T4020] el0t_64_sync_handler+0x84/0xe4 [ 47.336891][ T4020] el0t_64_sync+0x1a0/0x1a4 [ 47.337831][ T4020] [ 47.337831][ T4020] -> #1 (sb_internal#2){.+.+}-{0:0}: [ 47.339420][ T4020] lock_release+0x340/0xa1c [ 47.340422][ T4020] up_write+0x98/0x6f0 [ 47.341290][ T4020] btrfs_inode_unlock+0x40/0x80 [ 47.342387][ T4020] btrfs_sync_file+0x9a8/0xfd4 [ 47.343445][ T4020] __arm64_sys_fdatasync+0xac/0x104 [ 47.344678][ T4020] invoke_syscall+0x98/0x2b8 [ 47.345811][ T4020] el0_svc_common+0x138/0x258 [ 47.346835][ T4020] do_el0_svc+0x58/0x14c [ 47.347876][ T4020] el0_svc+0x7c/0x1f0 [ 47.348776][ T4020] el0t_64_sync_handler+0x84/0xe4 [ 47.349853][ T4020] el0t_64_sync+0x1a0/0x1a4 [ 47.350847][ T4020] [ 47.350847][ T4020] -> #0 (&type->i_mutex_dir_key#6){++++}-{3:3}: [ 47.352503][ T4020] __lock_acquire+0x32d4/0x7638 [ 47.353642][ T4020] lock_acquire+0x240/0x77c [ 47.354623][ T4020] down_read+0xc0/0x398 [ 47.355545][ T4020] lookup_slow+0x50/0x84 [ 47.356493][ T4020] walk_component+0x394/0x4cc [ 47.357455][ T4020] link_path_walk+0x5a0/0xc38 [ 47.358420][ T4020] path_lookupat+0x90/0x3d0 [ 47.359402][ T4020] filename_lookup+0x1c4/0x4c8 [ 47.360495][ T4020] kern_path+0x4c/0x194 [ 47.361399][ T4020] lookup_bdev+0xc0/0x25c [ 47.362320][ T4020] btrfs_free_stale_devices+0x658/0x9ec [ 47.363580][ T4020] btrfs_forget_devices+0x5c/0x98 [ 47.364652][ T4020] btrfs_control_ioctl+0x12c/0x248 [ 47.365810][ T4020] __arm64_sys_ioctl+0x14c/0x1c8 [ 47.366928][ T4020] invoke_syscall+0x98/0x2b8 [ 47.367926][ T4020] el0_svc_common+0x138/0x258 [ 47.368911][ T4020] do_el0_svc+0x58/0x14c [ 47.369903][ T4020] el0_svc+0x7c/0x1f0 [ 47.370919][ T4020] el0t_64_sync_handler+0x84/0xe4 [ 47.371997][ T4020] el0t_64_sync+0x1a0/0x1a4 [ 47.373107][ T4020] [ 47.373107][ T4020] other info that might help us debug this: [ 47.373107][ T4020] [ 47.375255][ T4020] Chain exists of: [ 47.375255][ T4020] &type->i_mutex_dir_key#6 --> &fs_info->tree_log_mutex --> &fs_devs->device_list_mutex [ 47.375255][ T4020] [ 47.378733][ T4020] Possible unsafe locking scenario: [ 47.378733][ T4020] [ 47.380225][ T4020] CPU0 CPU1 [ 47.381395][ T4020] ---- ---- [ 47.382504][ T4020] lock(&fs_devs->device_list_mutex); [ 47.383529][ T4020] lock(&fs_info->tree_log_mutex); [ 47.385029][ T4020] lock(&fs_devs->device_list_mutex); [ 47.386590][ T4020] lock(&type->i_mutex_dir_key#6); [ 47.387606][ T4020] [ 47.387606][ T4020] *** DEADLOCK *** [ 47.387606][ T4020] [ 47.389174][ T4020] 2 locks held by syz-executor563/4020: [ 47.390246][ T4020] #0: ffff800015221bc8 (uuid_mutex){+.+.}-{3:3}, at: btrfs_forget_devices+0x28/0x98 [ 47.392166][ T4020] #1: ffff0000da2cc8e0 (&fs_devs->device_list_mutex){+.+.}-{3:3}, at: btrfs_free_stale_devices+0x158/0x9ec [ 47.394658][ T4020] [ 47.394658][ T4020] stack backtrace: [ 47.395890][ T4020] CPU: 1 PID: 4020 Comm: syz-executor563 Not tainted 5.15.175-syzkaller #0 [ 47.397695][ T4020] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 [ 47.399566][ T4020] Call trace: [ 47.400275][ T4020] dump_backtrace+0x0/0x530 [ 47.401165][ T4020] show_stack+0x2c/0x3c [ 47.401969][ T4020] dump_stack_lvl+0x108/0x170 [ 47.402864][ T4020] dump_stack+0x1c/0x58 [ 47.403727][ T4020] print_circular_bug+0x150/0x1b8 [ 47.404834][ T4020] check_noncircular+0x2cc/0x378 [ 47.405852][ T4020] __lock_acquire+0x32d4/0x7638 [ 47.406813][ T4020] lock_acquire+0x240/0x77c [ 47.407674][ T4020] down_read+0xc0/0x398 [ 47.408508][ T4020] lookup_slow+0x50/0x84 [ 47.409426][ T4020] walk_component+0x394/0x4cc [ 47.410379][ T4020] link_path_walk+0x5a0/0xc38 [ 47.411353][ T4020] path_lookupat+0x90/0x3d0 [ 47.412252][ T4020] filename_lookup+0x1c4/0x4c8 [ 47.413243][ T4020] kern_path+0x4c/0x194 [ 47.414031][ T4020] lookup_bdev+0xc0/0x25c [ 47.414856][ T4020] btrfs_free_stale_devices+0x658/0x9ec [ 47.416085][ T4020] btrfs_forget_devices+0x5c/0x98 [ 47.417059][ T4020] btrfs_control_ioctl+0x12c/0x248 [ 47.418154][ T4020] __arm64_sys_ioctl+0x14c/0x1c8 [ 47.419134][ T4020] invoke_syscall+0x98/0x2b8 [ 47.420126][ T4020] el0_svc_common+0x138/0x258 [ 47.421059][ T4020] do_el0_svc+0x58/0x14c [ 47.422033][ T4020] el0_svc+0x7c/0x1f0 [ 47.422758][ T4020] el0t_64_sync_handler+0x84/0xe4 [ 47.423746][ T4020] el0t_64_sync+0x1a0/0x1a4 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