From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62563C64EC4 for ; Tue, 28 Feb 2023 21:16:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229870AbjB1VP7 (ORCPT ); Tue, 28 Feb 2023 16:15:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjB1VP6 (ORCPT ); Tue, 28 Feb 2023 16:15:58 -0500 Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E99B061AB for ; Tue, 28 Feb 2023 13:15:55 -0800 (PST) Received: by mail-io1-f69.google.com with SMTP id w4-20020a5d9604000000b0074d326b26bcso517152iol.9 for ; Tue, 28 Feb 2023 13:15:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:from:subject:message-id:date:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=aunH6rdCIjzCCa3AlQOm8uLa2dTuWVha0QFL6cudSV4=; b=mGv/bA53c1uNigSAu9oIfjrraw8QzQoKB2S8GTI5AnsJOTXdhK/nq+yB0xb0xZFb7p QyZiufvXKk1UB+MK0pGb9780AhHNXb2nfX7qyiVzOIfez8mb+tfuaEFg+nrgCMMtqeK1 dkg0YK+UhVBAWt46EsGNy/9EAH8NsWCtsR5baz0mJw79e5xqjzrTDb93nyHROuDHQ/j/ 51yRrDXS/7cSJxqGjjIoyOrSUK+1bT4+bFf385BOY5H8SLa62x8vrGCIE/hN9za9aw6p TBvWMY0fcvp31qRkwuFf/xeRvp0Hor1m+e/LsvSBl612C+7MYm7NvdnwZFkQ128q7j2P X7eQ== X-Gm-Message-State: AO0yUKV6XXs2Uo+gtKGt72HqhDLWw+YRXxdL7DJSAe1+aaG+Y690Nqr4 9vcvRq17eMuLAJk1MFdynr6sjjgRr/vfBPzFn4xj0+IZ3avzPps= X-Google-Smtp-Source: AK7set8MxM/tzuPvaNy0JLF6qwOY+Soj8ev2m2D3QxocKBefgh4qMrVPeibK6VjeImOtT5LX0hnclFU41gplzEUheqgK+gfjaj5D MIME-Version: 1.0 X-Received: by 2002:a5d:840d:0:b0:745:5135:b9e with SMTP id i13-20020a5d840d000000b0074551350b9emr1931321ion.2.1677618955251; Tue, 28 Feb 2023 13:15:55 -0800 (PST) Date: Tue, 28 Feb 2023 13:15:55 -0800 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <000000000000e578cb05f5c91997@google.com> Subject: [syzbot] [reiserfs?] possible deadlock in balance_pgdat From: syzbot To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, reiserfs-devel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Hello, syzbot found the following issue on: HEAD commit: ae3419fbac84 vc_screen: don't clobber return value in vcs_.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=10721d60c80000 kernel config: https://syzkaller.appspot.com/x/.config?x=ff98a3b3c1aed3ab dashboard link: https://syzkaller.appspot.com/bug?extid=bb678557e871cd928756 compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 Unfortunately, I don't have any reproducer for this issue yet. IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+bb678557e871cd928756@syzkaller.appspotmail.com ====================================================== WARNING: possible circular locking dependency detected 6.2.0-syzkaller-12913-gae3419fbac84 #0 Not tainted ------------------------------------------------------ kswapd0/100 is trying to acquire lock: ffff88801f2f4090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x79/0x100 fs/reiserfs/lock.c:27 but task is already holding lock: ffffffff8c8e29e0 (fs_reclaim){+.+.}-{0:0}, at: set_task_reclaim_state mm/vmscan.c:200 [inline] ffffffff8c8e29e0 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x170/0x1ac0 mm/vmscan.c:7338 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (fs_reclaim){+.+.}-{0:0}: __fs_reclaim_acquire mm/page_alloc.c:4716 [inline] fs_reclaim_acquire+0x11d/0x160 mm/page_alloc.c:4730 might_alloc include/linux/sched/mm.h:271 [inline] slab_pre_alloc_hook mm/slab.h:728 [inline] slab_alloc_node mm/slab.c:3241 [inline] slab_alloc mm/slab.c:3266 [inline] __kmem_cache_alloc_lru mm/slab.c:3443 [inline] kmem_cache_alloc_lru+0x3e/0x5d0 mm/slab.c:3459 __d_alloc+0x32/0x980 fs/dcache.c:1769 d_alloc_anon fs/dcache.c:1868 [inline] d_make_root+0x49/0x110 fs/dcache.c:2069 reiserfs_fill_super+0x1301/0x2ea0 fs/reiserfs/super.c:2083 mount_bdev+0x351/0x410 fs/super.c:1371 legacy_get_tree+0x109/0x220 fs/fs_context.c:610 vfs_get_tree+0x8d/0x350 fs/super.c:1501 do_new_mount fs/namespace.c:3042 [inline] path_mount+0x1342/0x1e40 fs/namespace.c:3372 do_mount fs/namespace.c:3385 [inline] __do_sys_mount fs/namespace.c:3594 [inline] __se_sys_mount fs/namespace.c:3571 [inline] __x64_sys_mount+0x283/0x300 fs/namespace.c:3571 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&sbi->lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain kernel/locking/lockdep.c:3832 [inline] __lock_acquire+0x2ec7/0x5d40 kernel/locking/lockdep.c:5056 lock_acquire kernel/locking/lockdep.c:5669 [inline] lock_acquire+0x1e3/0x670 kernel/locking/lockdep.c:5634 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1350 kernel/locking/mutex.c:747 reiserfs_write_lock+0x79/0x100 fs/reiserfs/lock.c:27 reiserfs_evict_inode+0x30b/0x540 fs/reiserfs/inode.c:55 evict+0x2ed/0x6b0 fs/inode.c:665 iput_final fs/inode.c:1748 [inline] iput.part.0+0x59b/0x8a0 fs/inode.c:1774 iput+0x5c/0x80 fs/inode.c:1764 dentry_unlink_inode+0x2b1/0x460 fs/dcache.c:401 __dentry_kill+0x3c0/0x640 fs/dcache.c:607 shrink_dentry_list+0x12c/0x4f0 fs/dcache.c:1201 prune_dcache_sb+0xeb/0x150 fs/dcache.c:1282 super_cache_scan+0x33a/0x590 fs/super.c:104 do_shrink_slab+0x464/0xd20 mm/vmscan.c:853 shrink_slab_memcg mm/vmscan.c:922 [inline] shrink_slab+0x388/0x660 mm/vmscan.c:1001 shrink_one+0x502/0x810 mm/vmscan.c:5343 shrink_many mm/vmscan.c:5394 [inline] lru_gen_shrink_node mm/vmscan.c:5511 [inline] shrink_node+0x2064/0x35f0 mm/vmscan.c:6459 kswapd_shrink_node mm/vmscan.c:7262 [inline] balance_pgdat+0xa02/0x1ac0 mm/vmscan.c:7452 kswapd+0x70b/0x1000 mm/vmscan.c:7712 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(fs_reclaim); lock(&sbi->lock); lock(fs_reclaim); lock(&sbi->lock); *** DEADLOCK *** 3 locks held by kswapd0/100: #0: ffffffff8c8e29e0 (fs_reclaim){+.+.}-{0:0}, at: set_task_reclaim_state mm/vmscan.c:200 [inline] #0: ffffffff8c8e29e0 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x170/0x1ac0 mm/vmscan.c:7338 #1: ffffffff8c8995d0 (shrinker_rwsem){++++}-{3:3}, at: shrink_slab_memcg mm/vmscan.c:895 [inline] #1: ffffffff8c8995d0 (shrinker_rwsem){++++}-{3:3}, at: shrink_slab+0x2a0/0x660 mm/vmscan.c:1001 #2: ffff88801230a0e0 (&type->s_umount_key#64){++++}-{3:3}, at: trylock_super fs/super.c:414 [inline] #2: ffff88801230a0e0 (&type->s_umount_key#64){++++}-{3:3}, at: super_cache_scan+0x70/0x590 fs/super.c:79 stack backtrace: CPU: 2 PID: 100 Comm: kswapd0 Not tainted 6.2.0-syzkaller-12913-gae3419fbac84 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain kernel/locking/lockdep.c:3832 [inline] __lock_acquire+0x2ec7/0x5d40 kernel/locking/lockdep.c:5056 lock_acquire kernel/locking/lockdep.c:5669 [inline] lock_acquire+0x1e3/0x670 kernel/locking/lockdep.c:5634 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1350 kernel/locking/mutex.c:747 reiserfs_write_lock+0x79/0x100 fs/reiserfs/lock.c:27 reiserfs_evict_inode+0x30b/0x540 fs/reiserfs/inode.c:55 evict+0x2ed/0x6b0 fs/inode.c:665 iput_final fs/inode.c:1748 [inline] iput.part.0+0x59b/0x8a0 fs/inode.c:1774 iput+0x5c/0x80 fs/inode.c:1764 dentry_unlink_inode+0x2b1/0x460 fs/dcache.c:401 __dentry_kill+0x3c0/0x640 fs/dcache.c:607 shrink_dentry_list+0x12c/0x4f0 fs/dcache.c:1201 prune_dcache_sb+0xeb/0x150 fs/dcache.c:1282 super_cache_scan+0x33a/0x590 fs/super.c:104 do_shrink_slab+0x464/0xd20 mm/vmscan.c:853 shrink_slab_memcg mm/vmscan.c:922 [inline] shrink_slab+0x388/0x660 mm/vmscan.c:1001 shrink_one+0x502/0x810 mm/vmscan.c:5343 shrink_many mm/vmscan.c:5394 [inline] lru_gen_shrink_node mm/vmscan.c:5511 [inline] shrink_node+0x2064/0x35f0 mm/vmscan.c:6459 kswapd_shrink_node mm/vmscan.c:7262 [inline] balance_pgdat+0xa02/0x1ac0 mm/vmscan.c:7452 kswapd+0x70b/0x1000 mm/vmscan.c:7712 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 --- This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at syzkaller@googlegroups.com. syzbot will keep track of this issue. See: https://goo.gl/tpsmEJ#status for how to communicate with syzbot.