====================================================== WARNING: possible circular locking dependency detected 4.14.307-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.5/10329 is trying to acquire lock: ("%s-%s""btrfs", name){+.+.}, at: [] flush_workqueue+0xcb/0x1310 kernel/workqueue.c:2622 but task is already holding lock: (&fs_info->scrub_lock){+.+.}, at: [] btrfs_scrub_dev+0x506/0xcd0 fs/btrfs/scrub.c:4217 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&fs_info->scrub_lock){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 btrfs_scrub_dev+0x1f3/0xcd0 fs/btrfs/scrub.c:4150 btrfs_ioctl_scrub fs/btrfs/ioctl.c:4451 [inline] btrfs_ioctl+0xba8/0x5b20 fs/btrfs/ioctl.c:5681 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 -> #2 (&fs_devs->device_list_mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 __reada_start_machine fs/btrfs/reada.c:765 [inline] reada_start_machine_worker+0x1d2/0xa90 fs/btrfs/reada.c:746 normal_work_helper+0x304/0x1330 fs/btrfs/async-thread.c:376 process_one_work+0x793/0x14a0 kernel/workqueue.c:2117 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2251 kthread+0x30d/0x420 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:406 -> #1 ((&work->normal_work)){+.+.}: process_one_work+0x736/0x14a0 kernel/workqueue.c:2093 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2251 kthread+0x30d/0x420 kernel/kthread.c:232 EXT4-fs error (device loop4): ext4_mb_generate_buddy:754: group 0, ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:406 -> #0 block bitmap and bg descriptor inconsistent: 25 vs 150994969 free clusters ("%s-%s""btrfs", name){+.+.}: lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 EXT4-fs (loop4): Delayed block allocation failed for inode 15 at logical offset 0 with max blocks 2048 with error 28 flush_workqueue+0xfa/0x1310 kernel/workqueue.c:2625 drain_workqueue+0x177/0x3e0 kernel/workqueue.c:2790 destroy_workqueue+0x71/0x710 kernel/workqueue.c:4116 EXT4-fs (loop4): This should not happen!! Data will be lost __btrfs_destroy_workqueue fs/btrfs/async-thread.c:436 [inline] btrfs_destroy_workqueue+0xf8/0x630 fs/btrfs/async-thread.c:447 scrub_workers_put+0x90/0x1a0 fs/btrfs/scrub.c:4075 btrfs_scrub_dev+0x536/0xcd0 fs/btrfs/scrub.c:4219 btrfs_ioctl_scrub fs/btrfs/ioctl.c:4451 [inline] btrfs_ioctl+0xba8/0x5b20 fs/btrfs/ioctl.c:5681 EXT4-fs (loop4): Total free blocks count 0 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692 EXT4-fs (loop4): Free/Dirty block details do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 other info that might help us debug this: EXT4-fs (loop4): free_blocks=2415919104 Chain exists of: "%s-%s""btrfs", name --> &fs_devs->device_list_mutex --> &fs_info->scrub_lock EXT4-fs (loop4): dirty_blocks=8192 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&fs_info->scrub_lock EXT4-fs (loop4): Block reservation details ); lock(&fs_devs->device_list_mutex); lock(&fs_info->scrub_lock EXT4-fs (loop4): i_reserved_data_blocks=512 ); lock("%s-%s""btrfs", name); *** DEADLOCK *** 1 lock held by syz-executor.5/10329: #0: (&fs_info->scrub_lock){+.+.}, at: [] btrfs_scrub_dev+0x506/0xcd0 fs/btrfs/scrub.c:4217 stack backtrace: CPU: 0 PID: 10329 Comm: syz-executor.5 Not tainted 4.14.307-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/16/2023 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 lib/dump_stack.c:58 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1258 check_prev_add kernel/locking/lockdep.c:1905 [inline] check_prevs_add kernel/locking/lockdep.c:2022 [inline] validate_chain kernel/locking/lockdep.c:2464 [inline] __lock_acquire+0x2e0e/0x3f20 kernel/locking/lockdep.c:3491 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 flush_workqueue+0xfa/0x1310 kernel/workqueue.c:2625 drain_workqueue+0x177/0x3e0 kernel/workqueue.c:2790 destroy_workqueue+0x71/0x710 kernel/workqueue.c:4116 __btrfs_destroy_workqueue fs/btrfs/async-thread.c:436 [inline] btrfs_destroy_workqueue+0xf8/0x630 fs/btrfs/async-thread.c:447 scrub_workers_put+0x90/0x1a0 fs/btrfs/scrub.c:4075 btrfs_scrub_dev+0x536/0xcd0 fs/btrfs/scrub.c:4219 btrfs_ioctl_scrub fs/btrfs/ioctl.c:4451 [inline] btrfs_ioctl+0xba8/0x5b20 fs/btrfs/ioctl.c:5681 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 RIP: 0033:0x7f24b41ae0f9 RSP: 002b:00007f24b2720168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f24b42cdf80 RCX: 00007f24b41ae0f9 RDX: 0000000020000100 RSI: 00000000c400941b RDI: 0000000000000004 RBP: 00007f24b4209ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd4de06f0f R14: 00007f24b2720300 R15: 0000000000022000 EXT4-fs (loop4): Delayed block allocation failed for inode 15 at logical offset 2050 with max blocks 2048 with error 28 EXT4-fs (loop4): This should not happen!! Data will be lost BTRFS info (device loop0): enabling inode map caching BTRFS info (device loop0): trying to use backup root at mount time BTRFS info (device loop0): use zlib compression BTRFS info (device loop0): enabling ssd optimizations BTRFS info (device loop0): using spread ssd allocation scheme BTRFS info (device loop0): using free space tree BTRFS info (device loop0): has skinny extents L1TF CPU bug present and SMT on, data leak possible. See CVE-2018-3646 and https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/l1tf.html for details. BTRFS info (device loop0): enabling inode map caching BTRFS info (device loop0): trying to use backup root at mount time BTRFS info (device loop0): use zlib compression BTRFS info (device loop0): enabling ssd optimizations BTRFS info (device loop0): using spread ssd allocation scheme BTRFS info (device loop0): using free space tree BTRFS info (device loop0): has skinny extents BTRFS info (device loop0): enabling inode map caching BTRFS info (device loop0): trying to use backup root at mount time BTRFS info (device loop0): use zlib compression BTRFS info (device loop0): enabling ssd optimizations BTRFS info (device loop0): using spread ssd allocation scheme BTRFS info (device loop0): using free space tree BTRFS info (device loop0): has skinny extents audit: type=1804 audit(1677543008.104:10): pid=10788 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir420903566/syzkaller.UJ05MF/55/bus/bus" dev="loop0" ino=8 res=1 audit: type=1804 audit(1677543008.264:11): pid=10805 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir420903566/syzkaller.UJ05MF/56/bus/bus" dev="loop0" ino=8 res=1 audit: type=1804 audit(1677543008.564:12): pid=10829 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir420903566/syzkaller.UJ05MF/57/bus/bus" dev="loop0" ino=8 res=1 audit: type=1804 audit(1677543008.844:13): pid=10846 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir420903566/syzkaller.UJ05MF/58/bus/bus" dev="loop0" ino=8 res=1 audit: type=1804 audit(1677543009.084:14): pid=10865 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir420903566/syzkaller.UJ05MF/59/bus/bus" dev="loop0" ino=8 res=1 audit: type=1804 audit(1677543009.284:15): pid=10878 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir420903566/syzkaller.UJ05MF/60/bus/bus" dev="loop0" ino=8 res=1 audit: type=1804 audit(1677543009.534:16): pid=10894 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir420903566/syzkaller.UJ05MF/61/bus/bus" dev="loop0" ino=8 res=1 audit: type=1804 audit(1677543009.744:17): pid=10911 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir420903566/syzkaller.UJ05MF/62/bus/bus" dev="loop0" ino=8 res=1 audit: type=1804 audit(1677543010.004:18): pid=10933 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir420903566/syzkaller.UJ05MF/63/bus/bus" dev="loop0" ino=8 res=1 audit: type=1804 audit(1677543010.494:19): pid=10972 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir420903566/syzkaller.UJ05MF/64/bus/bus" dev="loop0" ino=8 res=1 NILFS (loop1): invalid segment: Checksum error in segment payload NILFS (loop1): trying rollback from an earlier position NILFS (loop1): recovery complete NILFS (loop1): segctord starting. Construction interval = 5 seconds, CP frequency < 30 seconds NILFS (loop1): invalid segment: Checksum error in segment payload NILFS (loop3): invalid segment: Checksum error in segment payload NILFS (loop4): invalid segment: Checksum error in segment payload NILFS (loop1): trying rollback from an earlier position NILFS (loop3): trying rollback from an earlier position NILFS (loop4): trying rollback from an earlier position NILFS (loop1): recovery complete NILFS (loop3): recovery complete NILFS (loop3): segctord starting. Construction interval = 5 seconds, CP frequency < 30 seconds NILFS (loop1): segctord starting. Construction interval = 5 seconds, CP frequency < 30 seconds NILFS (loop4): recovery complete NILFS (loop4): segctord starting. Construction interval = 5 seconds, CP frequency < 30 seconds ntfs: volume version 3.1. NILFS (loop3): invalid segment: Checksum error in segment payload NILFS (loop1): invalid segment: Checksum error in segment payload NILFS (loop3): trying rollback from an earlier position NILFS (loop1): trying rollback from an earlier position NILFS (loop3): recovery complete NILFS (loop1): recovery complete NILFS (loop4): invalid segment: Checksum error in segment payload NILFS (loop3): segctord starting. Construction interval = 5 seconds, CP frequency < 30 seconds NILFS (loop4): trying rollback from an earlier position NILFS (loop1): segctord starting. Construction interval = 5 seconds, CP frequency < 30 seconds NILFS (loop4): recovery complete NILFS (loop4): segctord starting. Construction interval = 5 seconds, CP frequency < 30 seconds ntfs: volume version 3.1. ntfs: volume version 3.1. NILFS (loop3): invalid segment: Checksum error in segment payload NILFS (loop1): invalid segment: Checksum error in segment payload NILFS (loop3): trying rollback from an earlier position