syzbot


possible deadlock in xfs_icwalk_ag (2)

Status: upstream: reported on 2024/04/16 12:02
Subsystems: xfs
[Documentation on labels]
Reported-by: syzbot+4248e91deb3db78358a2@syzkaller.appspotmail.com
First crash: 39d, last: 10h07m
Discussions (2)
Title Replies (including bot) Last reply
[syzbot] Monthly xfs report (Apr 2024) 0 (1) 2024/04/29 12:34
[syzbot] [xfs?] possible deadlock in xfs_icwalk_ag (2) 0 (1) 2024/04/16 12:02
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in xfs_icwalk_ag xfs 14 42d 59d 0/26 closed as dup on 2024/03/23 08:37

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:
ffff88805ce5b758 (&xfs_dir_ilock_class){++++}-{3:3}, at: xfs_reclaim_inode fs/xfs/xfs_icache.c:943 [inline]
ffff88805ce5b758 (&xfs_dir_ilock_class){++++}-{3:3}, at: xfs_icwalk_process_inode fs/xfs/xfs_icache.c:1629 [inline]
ffff88805ce5b758 (&xfs_dir_ilock_class){++++}-{3:3}, at: xfs_icwalk_ag+0x120e/0x1ad0 fs/xfs/xfs_icache.c:1711

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:

-> #1 (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]
       slab_pre_alloc_hook mm/slub.c:3890 [inline]
       slab_alloc_node mm/slub.c:3980 [inline]
       __do_kmalloc_node mm/slub.c:4120 [inline]
       __kmalloc_noprof+0xae/0x410 mm/slub.c:4134
       kmalloc_noprof include/linux/slab.h:664 [inline]
       xfs_attr_shortform_list+0x753/0x1900 fs/xfs/xfs_attr_list.c:117
       xfs_attr_list+0x1d0/0x270 fs/xfs/xfs_attr_list.c:595
       xfs_vn_listxattr+0x1d2/0x2c0 fs/xfs/xfs_xattr.c:324
       vfs_listxattr fs/xattr.c:493 [inline]
       listxattr+0x107/0x290 fs/xattr.c:840
       path_listxattr fs/xattr.c:864 [inline]
       __do_sys_llistxattr fs/xattr.c:882 [inline]
       __se_sys_llistxattr fs/xattr.c:879 [inline]
       __x64_sys_llistxattr+0x173/0x230 fs/xattr.c:879
       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 (&xfs_dir_ilock_class){++++}-{3:3}:
       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
       down_write_nested+0x3d/0x50 kernel/locking/rwsem.c:1695
       xfs_reclaim_inode fs/xfs/xfs_icache.c:943 [inline]
       xfs_icwalk_process_inode fs/xfs/xfs_icache.c:1629 [inline]
       xfs_icwalk_ag+0x120e/0x1ad0 fs/xfs/xfs_icache.c:1711
       xfs_icwalk fs/xfs/xfs_icache.c:1760 [inline]
       xfs_reclaim_inodes_nr+0x257/0x360 fs/xfs/xfs_icache.c:1009
       super_cache_scan+0x40f/0x4b0 fs/super.c:227
       do_shrink_slab+0x705/0x1160 mm/shrinker.c:435
       shrink_slab+0x1092/0x14d0 mm/shrinker.c:662
       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:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(fs_reclaim);
                               lock(&xfs_dir_ilock_class);
                               lock(fs_reclaim);
  lock(&xfs_dir_ilock_class);

 *** 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: ffff8881ba4a00e0 (&type->s_umount_key#85){++++}-{3:3}, at: super_trylock_shared fs/super.c:562 [inline]
 #1: ffff8881ba4a00e0 (&type->s_umount_key#85){++++}-{3:3}, at: super_cache_scan+0x94/0x4b0 fs/super.c:196

stack backtrace:
CPU: 1 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
 down_write_nested+0x3d/0x50 kernel/locking/rwsem.c:1695
 xfs_reclaim_inode fs/xfs/xfs_icache.c:943 [inline]
 xfs_icwalk_process_inode fs/xfs/xfs_icache.c:1629 [inline]
 xfs_icwalk_ag+0x120e/0x1ad0 fs/xfs/xfs_icache.c:1711
 xfs_icwalk fs/xfs/xfs_icache.c:1760 [inline]
 xfs_reclaim_inodes_nr+0x257/0x360 fs/xfs/xfs_icache.c:1009
 super_cache_scan+0x40f/0x4b0 fs/super.c:227
 do_shrink_slab+0x705/0x1160 mm/shrinker.c:435
 shrink_slab+0x1092/0x14d0 mm/shrinker.c:662
 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 (57):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/21 16:13 upstream 8f6a15f095a6 1014eca7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in xfs_icwalk_ag
2024/05/15 21:23 upstream b850dc206a57 94b087b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/05/15 19:24 upstream b850dc206a57 94b087b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/05/14 21:48 upstream a5131c3fdf26 fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/05/14 18:23 upstream a5131c3fdf26 fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/05/14 12:58 upstream 8815da98e06a fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/05/14 06:11 upstream 8815da98e06a fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/05/13 16:46 upstream a38297e3fb01 9026e142 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/05/09 07:19 upstream 6d7ddd805123 20bf80e1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/05/08 04:03 upstream dccb07f2914c 4cf3f9b3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in xfs_icwalk_ag
2024/05/07 10:48 upstream dccb07f2914c c035c6de .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in xfs_icwalk_ag
2024/05/07 05:17 upstream ee5b455b0ada c035c6de .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in xfs_icwalk_ag
2024/05/06 19:28 upstream ee5b455b0ada c035c6de .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in xfs_icwalk_ag
2024/05/06 10:00 upstream dd5a440a31fa 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in xfs_icwalk_ag
2024/05/06 08:18 upstream dd5a440a31fa 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in xfs_icwalk_ag
2024/05/06 02:58 upstream b9158815de52 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/05/05 22:08 upstream b9158815de52 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in xfs_icwalk_ag
2024/05/05 19:59 upstream b9158815de52 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in xfs_icwalk_ag
2024/05/05 13:07 upstream 7367539ad4b0 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in xfs_icwalk_ag
2024/05/05 12:23 upstream 7367539ad4b0 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/05/05 02:57 upstream 7367539ad4b0 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/05/02 10:13 upstream 0106679839f7 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/05/01 20:54 upstream 0106679839f7 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/05/01 04:32 upstream 18daea77cca6 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/05/01 04:25 upstream 18daea77cca6 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/30 19:19 upstream 98369dccd2f8 3ce4924c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/30 02:53 upstream b947cc5bf6d7 27e33c58 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in xfs_icwalk_ag
2024/04/29 22:44 upstream b947cc5bf6d7 f10afd69 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/29 14:36 upstream e67572cd2204 27e33c58 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/29 07:20 upstream e67572cd2204 27e33c58 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/28 23:03 upstream e67572cd2204 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/28 20:29 upstream 2c8159388952 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/28 12:51 upstream 2c8159388952 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/27 21:28 upstream 5d12ed4bea43 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/27 18:45 upstream 5eb4573ea63d 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/27 06:44 upstream 5eb4573ea63d 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/27 01:17 upstream c942a0cd3603 059e9963 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/26 08:18 upstream c942a0cd3603 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/26 08:18 upstream c942a0cd3603 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/25 23:48 upstream e33c4963bf53 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/23 21:38 upstream 71b1543c83d6 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/23 03:26 upstream a2c63a3f3d68 36c961ad .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/22 04:00 upstream 3b68086599f8 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/21 13:40 upstream 977b1ef51866 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/21 11:54 upstream 977b1ef51866 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/21 05:28 upstream 977b1ef51866 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/21 00:53 upstream 977b1ef51866 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_icwalk_ag
2024/04/18 10:19 linux-next 7b4f2bc91c15 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in xfs_icwalk_ag
2024/04/18 10:18 linux-next 7b4f2bc91c15 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in xfs_icwalk_ag
2024/04/13 15:07 linux-next 9ed46da14b9b c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in xfs_icwalk_ag
2024/04/13 12:22 linux-next 9ed46da14b9b c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in xfs_icwalk_ag
2024/04/13 11:59 linux-next 9ed46da14b9b c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in xfs_icwalk_ag
2024/04/13 10:02 linux-next 9ed46da14b9b c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in xfs_icwalk_ag
2024/04/12 13:35 linux-next 4118d9533ff3 27de0a5c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in xfs_icwalk_ag
2024/04/12 13:28 linux-next 4118d9533ff3 27de0a5c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in xfs_icwalk_ag
2024/04/12 11:58 linux-next 4118d9533ff3 27de0a5c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in xfs_icwalk_ag
* Struck through repros no longer work on HEAD.