mapped:4569 shmem:2231 pagetables:456 sec_pagetables:293 bounce:0 kernel_misc_reclaimable:0 free:53520 free_pcp:52 free_cma:0 Node 0 active_anon:68kB inactive_anon:24kB active_file:784kB inactive_file:0kB unevictable:1360kB isolated(anon):0kB isolated(file):0kB mapped:556kB dirty:4kB writeback:0kB shmem:1360kB shmem_thp:0kB shmem_pmdmapped:0kB anon_thp:0kB writeback_tmp:0kB kernel_stack:3264kB pagetables:560kB sec_pagetables:1124kB all_unreclaimable? no Node 0 DMA free:824kB boost:0kB min:760kB low:948kB high:1136kB reserved_highatomic:0KB active_anon:0kB inactive_anon:0kB active_file:612kB inactive_file:0kB unevictable:592kB writepending:0kB present:15992kB managed:15360kB mlocked:0kB bounce:0kB free_pcp:184kB local_pcp:184kB free_cma:0kB lowmem_reserve[]: 0 86 0 0 0 Node 0 DMA32 free:7324kB boost:2048kB min:6456kB low:7556kB high:8656kB reserved_highatomic:0KB active_anon:68kB inactive_anon:24kB active_file:172kB inactive_file:0kB unevictable:768kB writepending:4kB present:770052kB managed:116620kB mlocked:0kB bounce:0kB free_pcp:24kB local_pcp:24kB free_cma:0kB lowmem_reserve[]: 0 0 0 0 0 Node 0 DMA: 7*4kB (UME) 15*8kB (UE) 0*16kB 11*32kB (UME) 3*64kB (UM) 1*128kB (M) 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 820kB Node 0 DMA32: 53*4kB (UME) 47*8kB (ME) 31*16kB (UME) 55*32kB (UME) 28*64kB (ME) 13*128kB (ME) 4*256kB (ME) 0*512kB 0*1024kB 0*2048kB 0*4096kB = 7324kB Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB Node 0 hugepages_total=2 hugepages_free=2 hugepages_surp=0 hugepages_size=2048kB 38804 total pagecache pages 40 pages in swap cache Free swap = 107032kB Total swap = 124996kB 393083 pages RAM 0 pages HighMem/MovableOnly 187369 pages reserved 0 pages cma reserved Tasks state (memory values in pages): [ pid ] uid tgid total_vm rss rss_anon rss_file rss_shmem pgtables_bytes swapents oom_score_adj name [ 4577] 0 4577 899 148 0 148 0 45056 32 0 syslogd [ 4580] 0 4580 572 13 0 13 0 40960 32 0 acpid [ 4584] 0 4584 899 150 0 150 0 45056 32 0 klogd [ 4595] 0 4595 4495 738 729 9 0 57344 64 -1000 udevd [ 4793] 100 4793 1036 130 37 93 0 49152 0 0 dbus-daemon [ 4808] 101 4808 990 474 391 83 0 53248 0 0 dhcpcd [ 4809] 0 4809 850 234 103 131 0 53248 0 0 dhcpcd [ 4810] 101 4810 672 117 39 78 0 53248 0 0 dhcpcd [ 4811] 101 4811 670 85 39 46 0 53248 0 0 dhcpcd [ 4889] 0 4889 1799 319 127 192 0 57344 0 -1000 sshd [ 4892] 0 4892 899 61 32 29 0 40960 0 0 getty [ 4916] 101 4916 850 182 100 82 0 53248 0 0 dhcpcd [ 4964] 101 4964 850 183 101 82 0 53248 0 0 dhcpcd [ 4966] 101 4966 850 183 101 82 0 53248 0 0 dhcpcd [ 4968] 101 4968 850 183 101 82 0 53248 0 0 dhcpcd [ 4974] 101 4974 850 183 101 82 0 53248 0 0 dhcpcd [ 4981] 101 4981 850 183 101 82 0 53248 0 0 dhcpcd [ 4982] 101 4982 850 183 101 82 0 53248 0 0 dhcpcd [ 4984] 101 4984 850 183 101 82 0 53248 0 0 dhcpcd [ 4986] 101 4986 850 183 101 82 0 53248 0 0 dhcpcd [ 5080] 0 5080 16065 4156 160 3996 0 139264 0 0 syz-executor [ 5090] 0 5090 18114 4064 154 3910 0 147456 0 0 syz-executor [ 5107] 0 5107 18180 4092 213 3879 0 159744 0 1000 syz.0.0 [ 5111] 0 5111 4495 666 637 29 0 53248 128 0 udevd oom-kill:constraint=CONSTRAINT_MEMORY_POLICY,nodemask=0,cpuset=/,mems_allowed=0-1,global_oom,task_memcg=/,task=syz.0.0,pid=5107,uid=0 Out of memory: Killed process 5107 (syz.0.0) total-vm:72720kB, anon-rss:852kB, file-rss:15516kB, shmem-rss:0kB, UID:0 pgtables:156kB oom_score_adj:1000 ====================================================== WARNING: possible circular locking dependency detected 6.12.0-rc4-syzkaller-00047-gc2ee9f594da8 #0 Not tainted ------------------------------------------------------ syz.0.0/5108 is trying to acquire lock: ffffffff8ea171c8 (pcpu_alloc_mutex){+.+.}-{3:3}, at: pcpu_alloc_noprof+0x27f/0x16b0 mm/percpu.c:1795 but task is already holding lock: ffff88804d101c50 (&bc->lock){+.+.}-{3:3}, at: bch2_btree_node_mem_alloc+0x4ec/0x1340 fs/bcachefs/btree_cache.c:782 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&bc->lock){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 bch2_btree_cache_scan+0x192/0xd00 fs/bcachefs/btree_cache.c:460 do_shrink_slab+0x701/0x1160 mm/shrinker.c:435 shrink_slab+0x1093/0x14d0 mm/shrinker.c:662 shrink_one+0x43b/0x850 mm/vmscan.c:4818 shrink_many mm/vmscan.c:4879 [inline] lru_gen_shrink_node mm/vmscan.c:4957 [inline] shrink_node+0x3791/0x3e20 mm/vmscan.c:5937 kswapd_shrink_node mm/vmscan.c:6765 [inline] balance_pgdat mm/vmscan.c:6957 [inline] kswapd+0x1ca3/0x3700 mm/vmscan.c:7226 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #1 (fs_reclaim){+.+.}-{0:0}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 __fs_reclaim_acquire mm/page_alloc.c:3834 [inline] fs_reclaim_acquire+0x88/0x130 mm/page_alloc.c:3848 might_alloc include/linux/sched/mm.h:318 [inline] slab_pre_alloc_hook mm/slub.c:4036 [inline] slab_alloc_node mm/slub.c:4114 [inline] __do_kmalloc_node mm/slub.c:4263 [inline] __kmalloc_noprof+0xa9/0x400 mm/slub.c:4276 kmalloc_noprof include/linux/slab.h:882 [inline] kzalloc_noprof include/linux/slab.h:1014 [inline] pcpu_mem_zalloc mm/percpu.c:510 [inline] pcpu_alloc_chunk mm/percpu.c:1443 [inline] pcpu_create_chunk+0x57/0xbc0 mm/percpu-vm.c:338 pcpu_balance_populated mm/percpu.c:2075 [inline] pcpu_balance_workfn+0xc4d/0xd40 mm/percpu.c:2212 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3310 worker_thread+0x870/0xd30 kernel/workqueue.c:3391 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #0 (pcpu_alloc_mutex){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 pcpu_alloc_noprof+0x27f/0x16b0 mm/percpu.c:1795 __six_lock_init+0x104/0x150 fs/bcachefs/six.c:869 bch2_btree_lock_init+0x38/0x100 fs/bcachefs/btree_locking.c:12 bch2_btree_node_mem_alloc+0x4f8/0x1340 fs/bcachefs/btree_cache.c:785 __bch2_btree_node_alloc fs/bcachefs/btree_update_interior.c:325 [inline] bch2_btree_reserve_get+0x2df/0x1890 fs/bcachefs/btree_update_interior.c:554 bch2_btree_update_start+0xe56/0x14e0 fs/bcachefs/btree_update_interior.c:1252 bch2_btree_split_leaf+0x123/0x840 fs/bcachefs/btree_update_interior.c:1850 bch2_trans_commit_error+0x212/0x1390 fs/bcachefs/btree_trans_commit.c:942 __bch2_trans_commit+0x7ead/0x93c0 fs/bcachefs/btree_trans_commit.c:1140 wb_flush_one fs/bcachefs/btree_write_buffer.c:183 [inline] bch2_btree_write_buffer_flush_locked+0x2aa8/0x59f0 fs/bcachefs/btree_write_buffer.c:375 btree_write_buffer_flush_seq+0x1a43/0x1bc0 fs/bcachefs/btree_write_buffer.c:510 bch2_btree_write_buffer_journal_flush+0x4e/0x80 fs/bcachefs/btree_write_buffer.c:525 journal_flush_pins+0x5f7/0xb20 fs/bcachefs/journal_reclaim.c:565 journal_flush_done+0x8e/0x260 fs/bcachefs/journal_reclaim.c:819 bch2_journal_flush_pins+0x18a/0x3a0 fs/bcachefs/journal_reclaim.c:852 bch2_journal_flush_all_pins fs/bcachefs/journal_reclaim.h:76 [inline] bch2_journal_replay+0x270f/0x2a40 fs/bcachefs/recovery.c:384 bch2_run_recovery_pass+0xf0/0x1e0 fs/bcachefs/recovery_passes.c:185 bch2_run_recovery_passes+0x387/0x870 fs/bcachefs/recovery_passes.c:232 bch2_fs_recovery+0x25cc/0x39c0 fs/bcachefs/recovery.c:862 bch2_fs_start+0x356/0x5b0 fs/bcachefs/super.c:1036 bch2_fs_get_tree+0xd68/0x1710 fs/bcachefs/fs.c:2174 vfs_get_tree+0x90/0x2b0 fs/super.c:1800 do_new_mount+0x2be/0xb40 fs/namespace.c:3507 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:4034 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: pcpu_alloc_mutex --> fs_reclaim --> &bc->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&bc->lock); lock(fs_reclaim); lock(&bc->lock); lock(pcpu_alloc_mutex); *** DEADLOCK *** 6 locks held by syz.0.0/5108: #0: ffff88804d100278 (&c->state_lock){+.+.}-{3:3}, at: bch2_fs_start+0x45/0x5b0 fs/bcachefs/super.c:1006 #1: ffff88804d14b0a8 (&j->reclaim_lock){+.+.}-{3:3}, at: journal_flush_done+0x79/0x260 fs/bcachefs/journal_reclaim.c:817 #2: ffff88804d104398 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:151 [inline] #2: ffff88804d104398 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:250 [inline] #2: ffff88804d104398 (&c->btree_trans_barrier){.+.+}-{0:0}, at: __bch2_trans_get+0x7de/0xd20 fs/bcachefs/btree_iter.c:3215 #3: ffff88804d104740 (&wb->flushing.lock){+.+.}-{3:3}, at: btree_write_buffer_flush_seq+0x1a39/0x1bc0 fs/bcachefs/btree_write_buffer.c:509 #4: ffff88804d1266d0 (&c->gc_lock){++++}-{3:3}, at: bch2_btree_update_start+0x682/0x14e0 fs/bcachefs/btree_update_interior.c:1202 #5: ffff88804d101c50 (&bc->lock){+.+.}-{3:3}, at: bch2_btree_node_mem_alloc+0x4ec/0x1340 fs/bcachefs/btree_cache.c:782 stack backtrace: CPU: 0 UID: 0 PID: 5108 Comm: syz.0.0 Not tainted 6.12.0-rc4-syzkaller-00047-gc2ee9f594da8 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2074 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 pcpu_alloc_noprof+0x27f/0x16b0 mm/percpu.c:1795 __six_lock_init+0x104/0x150 fs/bcachefs/six.c:869 bch2_btree_lock_init+0x38/0x100 fs/bcachefs/btree_locking.c:12 bch2_btree_node_mem_alloc+0x4f8/0x1340 fs/bcachefs/btree_cache.c:785 __bch2_btree_node_alloc fs/bcachefs/btree_update_interior.c:325 [inline] bch2_btree_reserve_get+0x2df/0x1890 fs/bcachefs/btree_update_interior.c:554 bch2_btree_update_start+0xe56/0x14e0 fs/bcachefs/btree_update_interior.c:1252 bch2_btree_split_leaf+0x123/0x840 fs/bcachefs/btree_update_interior.c:1850 bch2_trans_commit_error+0x212/0x1390 fs/bcachefs/btree_trans_commit.c:942 __bch2_trans_commit+0x7ead/0x93c0 fs/bcachefs/btree_trans_commit.c:1140 wb_flush_one fs/bcachefs/btree_write_buffer.c:183 [inline] bch2_btree_write_buffer_flush_locked+0x2aa8/0x59f0 fs/bcachefs/btree_write_buffer.c:375 btree_write_buffer_flush_seq+0x1a43/0x1bc0 fs/bcachefs/btree_write_buffer.c:510 bch2_btree_write_buffer_journal_flush+0x4e/0x80 fs/bcachefs/btree_write_buffer.c:525 journal_flush_pins+0x5f7/0xb20 fs/bcachefs/journal_reclaim.c:565 journal_flush_done+0x8e/0x260 fs/bcachefs/journal_reclaim.c:819 bch2_journal_flush_pins+0x18a/0x3a0 fs/bcachefs/journal_reclaim.c:852 bch2_journal_flush_all_pins fs/bcachefs/journal_reclaim.h:76 [inline] bch2_journal_replay+0x270f/0x2a40 fs/bcachefs/recovery.c:384 bch2_run_recovery_pass+0xf0/0x1e0 fs/bcachefs/recovery_passes.c:185 bch2_run_recovery_passes+0x387/0x870 fs/bcachefs/recovery_passes.c:232 bch2_fs_recovery+0x25cc/0x39c0 fs/bcachefs/recovery.c:862 bch2_fs_start+0x356/0x5b0 fs/bcachefs/super.c:1036 bch2_fs_get_tree+0xd68/0x1710 fs/bcachefs/fs.c:2174 vfs_get_tree+0x90/0x2b0 fs/super.c:1800 do_new_mount+0x2be/0xb40 fs/namespace.c:3507 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:4034 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f6352b7f79a Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f635392be68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f635392bef0 RCX: 00007f6352b7f79a RDX: 0000000020000300 RSI: 0000000020005900 RDI: 00007f635392beb0 RBP: 0000000020000300 R08: 00007f635392bef0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020005900 R13: 00007f635392beb0 R14: 00000000000058af R15: 0000000020000000 bcachefs (loop0): bch2_journal_replay(): error ERESTARTSYS bcachefs (loop0): bch2_fs_recovery(): error ERESTARTSYS bcachefs (loop0): bch2_fs_start(): error starting filesystem ERESTARTSYS bcachefs (loop0): shutting down bcachefs (loop0): shutdown complete bcachefs: bch2_fs_get_tree() error: ERESTARTSYS