syzbot


possible deadlock in nilfs_evict_inode (2)

Status: upstream: reported on 2024/05/18 18:53
Subsystems: nilfs
[Documentation on labels]
Reported-by: syzbot+c48f1971ba117125f94c@syzkaller.appspotmail.com
First crash: 34d, last: 5d08h
Discussions (2)
Title Replies (including bot) Last reply
[syzbot] Monthly nilfs report (Jun 2024) 0 (1) 2024/06/10 20:56
[syzbot] [nilfs?] possible deadlock in nilfs_evict_inode (2) 1 (2) 2024/05/18 19:20
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in nilfs_evict_inode nilfs 5 455d 473d 22/27 fixed on 2023/06/08 14:41

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.9.0-syzkaller-10323-g8f6a15f095a6 #0 Not tainted
------------------------------------------------------
kswapd0/89 is trying to acquire lock:
ffff8881bbb7c610 (sb_internal#5){.+.+}-{0:0}, at: nilfs_evict_inode+0x167/0x500 fs/nilfs2/inode.c:924

but task is already holding lock:
ffffffff8e429680 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat mm/vmscan.c:6798 [inline]
ffffffff8e429680 (fs_reclaim){+.+.}-{0:0}, at: kswapd+0xb1e/0x2f30 mm/vmscan.c:7180

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (fs_reclaim){+.+.}-{0:0}:
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
       __fs_reclaim_acquire mm/page_alloc.c:3783 [inline]
       fs_reclaim_acquire+0x88/0x140 mm/page_alloc.c:3797
       might_alloc include/linux/sched/mm.h:334 [inline]
       prepare_alloc_pages+0x147/0x5d0 mm/page_alloc.c:4431
       __alloc_pages_noprof+0x166/0x6c0 mm/page_alloc.c:4649
       alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265
       alloc_pages_noprof mm/mempolicy.c:2336 [inline]
       folio_alloc_noprof+0x128/0x180 mm/mempolicy.c:2343
       filemap_alloc_folio_noprof+0xdf/0x500 mm/filemap.c:1008
       __filemap_get_folio+0x41a/0xbb0 mm/filemap.c:1950
       pagecache_get_page+0x2c/0x200 mm/folio-compat.c:87
       block_write_begin+0x31/0x1e0 fs/buffer.c:2232
       nilfs_write_begin+0xa0/0x110 fs/nilfs2/inode.c:262
       page_symlink+0x2a6/0x4a0 fs/namei.c:5236
       nilfs_symlink+0x236/0x380 fs/nilfs2/namei.c:153
       vfs_symlink+0x137/0x2e0 fs/namei.c:4489
       do_symlinkat+0x222/0x3a0 fs/namei.c:4515
       __do_sys_symlink fs/namei.c:4536 [inline]
       __se_sys_symlink fs/namei.c:4534 [inline]
       __x64_sys_symlink+0x7e/0x90 fs/namei.c:4534
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #1 (&nilfs->ns_segctor_sem){++++}-{3:3}:
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
       down_read+0xb1/0xa40 kernel/locking/rwsem.c:1526
       nilfs_transaction_begin+0x320/0x6e0 fs/nilfs2/segment.c:223
       nilfs_create+0xc7/0x2d0 fs/nilfs2/namei.c:82
       lookup_open fs/namei.c:3505 [inline]
       open_last_lookups fs/namei.c:3574 [inline]
       path_openat+0x1425/0x3280 fs/namei.c:3804
       do_filp_open+0x235/0x490 fs/namei.c:3834
       do_sys_openat2+0x13e/0x1d0 fs/open.c:1406
       do_sys_open fs/open.c:1421 [inline]
       __do_sys_openat fs/open.c:1437 [inline]
       __se_sys_openat fs/open.c:1432 [inline]
       __x64_sys_openat+0x247/0x2a0 fs/open.c:1432
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (sb_internal#5){.+.+}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3134 [inline]
       check_prevs_add kernel/locking/lockdep.c:3253 [inline]
       validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869
       __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       __sb_start_write include/linux/fs.h:1655 [inline]
       sb_start_intwrite include/linux/fs.h:1838 [inline]
       nilfs_transaction_begin+0x216/0x6e0 fs/nilfs2/segment.c:220
       nilfs_evict_inode+0x167/0x500 fs/nilfs2/inode.c:924
       evict+0x2a8/0x630 fs/inode.c:667
       __dentry_kill+0x20d/0x630 fs/dcache.c:603
       dput+0x19f/0x2b0 fs/dcache.c:845
       ovl_destroy_inode+0x44/0x160 fs/overlayfs/super.c:181
       destroy_inode fs/inode.c:311 [inline]
       evict+0x549/0x630 fs/inode.c:682
       __dentry_kill+0x20d/0x630 fs/dcache.c:603
       shrink_kill+0xa9/0x2c0 fs/dcache.c:1048
       shrink_dentry_list+0x2c0/0x5b0 fs/dcache.c:1075
       prune_dcache_sb+0x10f/0x180 fs/dcache.c:1156
       super_cache_scan+0x34f/0x4b0 fs/super.c:221
       do_shrink_slab+0x705/0x1160 mm/shrinker.c:435
       shrink_slab_memcg mm/shrinker.c:548 [inline]
       shrink_slab+0x883/0x14d0 mm/shrinker.c:626
       shrink_node_memcgs mm/vmscan.c:5891 [inline]
       shrink_node+0x10ec/0x2a30 mm/vmscan.c:5924
       kswapd_shrink_node mm/vmscan.c:6720 [inline]
       balance_pgdat mm/vmscan.c:6911 [inline]
       kswapd+0x19a4/0x2f30 mm/vmscan.c:7180
       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

other info that might help us debug this:

Chain exists of:
  sb_internal#5 --> &nilfs->ns_segctor_sem --> fs_reclaim

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(fs_reclaim);
                               lock(&nilfs->ns_segctor_sem);
                               lock(fs_reclaim);
  rlock(sb_internal#5);

 *** DEADLOCK ***

2 locks held by kswapd0/89:
 #0: ffffffff8e429680 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat mm/vmscan.c:6798 [inline]
 #0: ffffffff8e429680 (fs_reclaim){+.+.}-{0:0}, at: kswapd+0xb1e/0x2f30 mm/vmscan.c:7180
 #1: ffff8881bc73c0e0 (&type->s_umount_key#103){++++}-{3:3}, at: super_trylock_shared fs/super.c:562 [inline]
 #1: ffff8881bc73c0e0 (&type->s_umount_key#103){++++}-{3:3}, at: super_cache_scan+0x94/0x4b0 fs/super.c:196

stack backtrace:
CPU: 0 PID: 89 Comm: kswapd0 Not tainted 6.9.0-syzkaller-10323-g8f6a15f095a6 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2187
 check_prev_add kernel/locking/lockdep.c:3134 [inline]
 check_prevs_add kernel/locking/lockdep.c:3253 [inline]
 validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869
 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
 percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
 __sb_start_write include/linux/fs.h:1655 [inline]
 sb_start_intwrite include/linux/fs.h:1838 [inline]
 nilfs_transaction_begin+0x216/0x6e0 fs/nilfs2/segment.c:220
 nilfs_evict_inode+0x167/0x500 fs/nilfs2/inode.c:924
 evict+0x2a8/0x630 fs/inode.c:667
 __dentry_kill+0x20d/0x630 fs/dcache.c:603
 dput+0x19f/0x2b0 fs/dcache.c:845
 ovl_destroy_inode+0x44/0x160 fs/overlayfs/super.c:181
 destroy_inode fs/inode.c:311 [inline]
 evict+0x549/0x630 fs/inode.c:682
 __dentry_kill+0x20d/0x630 fs/dcache.c:603
 shrink_kill+0xa9/0x2c0 fs/dcache.c:1048
 shrink_dentry_list+0x2c0/0x5b0 fs/dcache.c:1075
 prune_dcache_sb+0x10f/0x180 fs/dcache.c:1156
 super_cache_scan+0x34f/0x4b0 fs/super.c:221
 do_shrink_slab+0x705/0x1160 mm/shrinker.c:435
 shrink_slab_memcg mm/shrinker.c:548 [inline]
 shrink_slab+0x883/0x14d0 mm/shrinker.c:626
 shrink_node_memcgs mm/vmscan.c:5891 [inline]
 shrink_node+0x10ec/0x2a30 mm/vmscan.c:5924
 kswapd_shrink_node mm/vmscan.c:6720 [inline]
 balance_pgdat mm/vmscan.c:6911 [inline]
 kswapd+0x19a4/0x2f30 mm/vmscan.c:7180
 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
 </TASK>

Crashes (73):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/21 18:58 upstream 8f6a15f095a6 4c0d3ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in nilfs_evict_inode
2024/06/13 04:55 upstream cea2a26553ac c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/13 01:18 upstream cea2a26553ac c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 19:18 upstream 71d7b52cc33b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 14:21 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 10:22 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 10:03 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 10:03 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 10:02 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 10:02 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 10:00 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:59 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:59 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:58 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:58 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:42 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:42 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:41 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:41 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:40 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:40 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:39 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:39 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:38 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:37 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:37 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:36 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:35 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:35 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:34 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:33 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:33 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:32 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:31 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:31 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:30 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:30 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:29 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:29 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:28 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:28 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 09:27 upstream 32f88d65f01b c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/05/21 07:44 upstream 8f6a15f095a6 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/05/21 07:44 upstream 8f6a15f095a6 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/05/21 07:44 upstream 8f6a15f095a6 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/05/14 18:47 upstream 6bfd2d442af5 fdb4c10c .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in nilfs_evict_inode
2024/06/05 22:19 linux-next 234cb065ad82 121701b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in nilfs_evict_inode
* Struck through repros no longer work on HEAD.