Warning: Permanently added '10.128.1.76' (ED25519) to the list of known hosts. executing program [ 41.401384][ T3961] loop0: detected capacity change from 0 to 32768 [ 41.481797][ T3961] BTRFS: device fsid a6a605fc-d5f1-4e66-8595-3726e2b761d6 devid 1 transid 8 /dev/loop0 scanned by syz-executor391 (3961) [ 41.523675][ T3961] BTRFS info (device loop0): using blake2b (blake2b-256-generic) checksum algorithm [ 41.526017][ T3961] BTRFS info (device loop0): turning on sync discard [ 41.527670][ T3961] BTRFS info (device loop0): using free space tree [ 41.529220][ T3961] BTRFS info (device loop0): has skinny extents [ 41.548958][ T3961] BTRFS info (device loop0): enabling ssd optimizations [ 41.564093][ T3961] [ 41.564680][ T3961] ====================================================== [ 41.566357][ T3961] WARNING: possible circular locking dependency detected [ 41.568038][ T3961] 5.15.150-syzkaller #0 Not tainted [ 41.569249][ T3961] ------------------------------------------------------ [ 41.570912][ T3961] syz-executor391/3961 is trying to acquire lock: [ 41.572505][ T3961] ffff0000df030fe0 (&type->i_mutex_dir_key#6){++++}-{3:3}, at: lookup_slow+0x50/0x84 [ 41.574861][ T3961] [ 41.574861][ T3961] but task is already holding lock: [ 41.576665][ T3961] ffff0000d9ea8ce0 (&fs_devs->device_list_mutex){+.+.}-{3:3}, at: btrfs_free_stale_devices+0x158/0x9ec [ 41.579417][ T3961] [ 41.579417][ T3961] which lock already depends on the new lock. [ 41.579417][ T3961] [ 41.582041][ T3961] [ 41.582041][ T3961] the existing dependency chain (in reverse order) is: [ 41.584262][ T3961] [ 41.584262][ T3961] -> #3 (&fs_devs->device_list_mutex){+.+.}-{3:3}: [ 41.586359][ T3961] __mutex_lock_common+0x194/0x2154 [ 41.587774][ T3961] mutex_lock_nested+0xa4/0xf8 [ 41.589133][ T3961] write_all_supers+0x134c/0x3a6c [ 41.590459][ T3961] btrfs_sync_log+0x19c8/0x2294 [ 41.591795][ T3961] btrfs_sync_file+0x924/0xe60 [ 41.593156][ T3961] __arm64_sys_fdatasync+0xac/0x104 [ 41.594576][ T3961] invoke_syscall+0x98/0x2b8 [ 41.595838][ T3961] el0_svc_common+0x138/0x258 [ 41.597176][ T3961] do_el0_svc+0x58/0x14c [ 41.598361][ T3961] el0_svc+0x7c/0x1f0 [ 41.599439][ T3961] el0t_64_sync_handler+0x84/0xe4 [ 41.600813][ T3961] el0t_64_sync+0x1a0/0x1a4 [ 41.602097][ T3961] [ 41.602097][ T3961] -> #2 (&fs_info->tree_log_mutex){+.+.}-{3:3}: [ 41.604254][ T3961] __mutex_lock_common+0x194/0x2154 [ 41.605724][ T3961] mutex_lock_nested+0xa4/0xf8 [ 41.607062][ T3961] btrfs_sync_log+0x1904/0x2294 [ 41.608404][ T3961] btrfs_sync_file+0x924/0xe60 [ 41.609697][ T3961] __arm64_sys_fdatasync+0xac/0x104 [ 41.611128][ T3961] invoke_syscall+0x98/0x2b8 [ 41.612374][ T3961] el0_svc_common+0x138/0x258 [ 41.613657][ T3961] do_el0_svc+0x58/0x14c [ 41.614837][ T3961] el0_svc+0x7c/0x1f0 [ 41.615956][ T3961] el0t_64_sync_handler+0x84/0xe4 [ 41.617290][ T3961] el0t_64_sync+0x1a0/0x1a4 [ 41.618522][ T3961] [ 41.618522][ T3961] -> #1 (sb_internal#2){.+.+}-{0:0}: [ 41.620402][ T3961] lock_release+0x340/0xa1c [ 41.621666][ T3961] up_write+0x98/0x438 [ 41.622798][ T3961] btrfs_inode_unlock+0x40/0x80 [ 41.624160][ T3961] btrfs_sync_file+0x870/0xe60 [ 41.625477][ T3961] __arm64_sys_fdatasync+0xac/0x104 [ 41.626902][ T3961] invoke_syscall+0x98/0x2b8 [ 41.628247][ T3961] el0_svc_common+0x138/0x258 [ 41.629589][ T3961] do_el0_svc+0x58/0x14c [ 41.630801][ T3961] el0_svc+0x7c/0x1f0 [ 41.631999][ T3961] el0t_64_sync_handler+0x84/0xe4 [ 41.633414][ T3961] el0t_64_sync+0x1a0/0x1a4 [ 41.634613][ T3961] [ 41.634613][ T3961] -> #0 (&type->i_mutex_dir_key#6){++++}-{3:3}: [ 41.636796][ T3961] __lock_acquire+0x32d4/0x7638 [ 41.638087][ T3961] lock_acquire+0x240/0x77c [ 41.639362][ T3961] down_read+0xc0/0x398 [ 41.640532][ T3961] lookup_slow+0x50/0x84 [ 41.641690][ T3961] walk_component+0x394/0x4cc [ 41.642961][ T3961] link_path_walk+0x5a0/0xc38 [ 41.644238][ T3961] path_lookupat+0x90/0x3d0 [ 41.645520][ T3961] filename_lookup+0x1c4/0x4c8 [ 41.646883][ T3961] kern_path+0x4c/0x194 [ 41.648053][ T3961] lookup_bdev+0xc0/0x25c [ 41.649225][ T3961] btrfs_free_stale_devices+0x658/0x9ec [ 41.650752][ T3961] btrfs_forget_devices+0x5c/0x98 [ 41.652113][ T3961] btrfs_control_ioctl+0x12c/0x248 [ 41.653567][ T3961] __arm64_sys_ioctl+0x14c/0x1c8 [ 41.654900][ T3961] invoke_syscall+0x98/0x2b8 [ 41.656158][ T3961] el0_svc_common+0x138/0x258 [ 41.657428][ T3961] do_el0_svc+0x58/0x14c [ 41.658539][ T3961] el0_svc+0x7c/0x1f0 [ 41.659698][ T3961] el0t_64_sync_handler+0x84/0xe4 [ 41.661067][ T3961] el0t_64_sync+0x1a0/0x1a4 [ 41.662321][ T3961] [ 41.662321][ T3961] other info that might help us debug this: [ 41.662321][ T3961] [ 41.664821][ T3961] Chain exists of: [ 41.664821][ T3961] &type->i_mutex_dir_key#6 --> &fs_info->tree_log_mutex --> &fs_devs->device_list_mutex [ 41.664821][ T3961] [ 41.668711][ T3961] Possible unsafe locking scenario: [ 41.668711][ T3961] [ 41.670574][ T3961] CPU0 CPU1 [ 41.671897][ T3961] ---- ---- [ 41.673226][ T3961] lock(&fs_devs->device_list_mutex); [ 41.674547][ T3961] lock(&fs_info->tree_log_mutex); [ 41.676504][ T3961] lock(&fs_devs->device_list_mutex); [ 41.678449][ T3961] lock(&type->i_mutex_dir_key#6); [ 41.679781][ T3961] [ 41.679781][ T3961] *** DEADLOCK *** [ 41.679781][ T3961] [ 41.681751][ T3961] 2 locks held by syz-executor391/3961: [ 41.683175][ T3961] #0: ffff800014fa5e28 (uuid_mutex){+.+.}-{3:3}, at: btrfs_forget_devices+0x28/0x98 [ 41.685565][ T3961] #1: ffff0000d9ea8ce0 (&fs_devs->device_list_mutex){+.+.}-{3:3}, at: btrfs_free_stale_devices+0x158/0x9ec [ 41.688433][ T3961] [ 41.688433][ T3961] stack backtrace: [ 41.689898][ T3961] CPU: 1 PID: 3961 Comm: syz-executor391 Not tainted 5.15.150-syzkaller #0 [ 41.692048][ T3961] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 [ 41.694579][ T3961] Call trace: [ 41.695371][ T3961] dump_backtrace+0x0/0x530 [ 41.696464][ T3961] show_stack+0x2c/0x3c [ 41.697531][ T3961] dump_stack_lvl+0x108/0x170 [ 41.698717][ T3961] dump_stack+0x1c/0x58 [ 41.699741][ T3961] print_circular_bug+0x150/0x1b8 [ 41.700915][ T3961] check_noncircular+0x2cc/0x378 [ 41.702111][ T3961] __lock_acquire+0x32d4/0x7638 [ 41.703308][ T3961] lock_acquire+0x240/0x77c [ 41.704432][ T3961] down_read+0xc0/0x398 [ 41.705514][ T3961] lookup_slow+0x50/0x84 [ 41.706539][ T3961] walk_component+0x394/0x4cc [ 41.707684][ T3961] link_path_walk+0x5a0/0xc38 [ 41.708821][ T3961] path_lookupat+0x90/0x3d0 [ 41.709916][ T3961] filename_lookup+0x1c4/0x4c8 [ 41.711146][ T3961] kern_path+0x4c/0x194 [ 41.712166][ T3961] lookup_bdev+0xc0/0x25c [ 41.713207][ T3961] btrfs_free_stale_devices+0x658/0x9ec [ 41.714588][ T3961] btrfs_forget_devices+0x5c/0x98 [ 41.715845][ T3961] btrfs_control_ioctl+0x12c/0x248 [ 41.717107][ T3961] __arm64_sys_ioctl+0x14c/0x1c8 [ 41.718328][ T3961] invoke_syscall+0x98/0x2b8 [ 41.719477][ T3961] el0_svc_common+0x138/0x258 [ 41.720681][ T3961] do_el0_svc+0x58/0x14c [ 41.721709][ T3961] el0_svc+0x7c/0x1f0 [ 41.722744][ T3961] el0t_64_sync_handler+0x84/0xe4 [ 41.723986][ T3961] el0t_64_sync+0x1a0/0x1a4