syzbot


possible deadlock in xfs_can_free_eofblocks (2)

Status: upstream: reported C repro on 2024/08/15 12:35
Subsystems: xfs
[Documentation on labels]
Reported-by: syzbot+53d541c7b07d55a392ca@syzkaller.appspotmail.com
First crash: 129d, last: 16d
Discussions (2)
Title Replies (including bot) Last reply
[syzbot] Monthly xfs report (Oct 2024) 0 (1) 2024/10/16 15:36
[syzbot] [xfs?] possible deadlock in xfs_can_free_eofblocks (2) 1 (3) 2024/09/14 09:21
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in xfs_can_free_eofblocks xfs 4 199d 224d 26/28 fixed on 2024/07/03 15:06
Last patch testing requests (10)
Created Duration User Patch Repo Result
2024/11/01 02:50 19m retest repro upstream OK log
2024/11/01 02:50 18m retest repro upstream OK log
2024/11/01 02:50 18m retest repro upstream OK log
2024/11/01 02:50 18m retest repro upstream OK log
2024/11/01 01:13 18m retest repro upstream OK log
2024/11/01 01:13 18m retest repro upstream OK log
2024/11/01 01:13 18m retest repro upstream OK log
2024/11/01 01:13 18m retest repro upstream OK log
2024/11/01 01:13 19m retest repro upstream OK log
2024/09/14 09:01 19m lizhi.xu@windriver.com patch upstream OK log

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.11.0-rc3-syzkaller-00279-ge5fa841af679 #0 Not tainted
------------------------------------------------------
kswapd0/90 is trying to acquire lock:
ffff88808549ed98 (&xfs_nondir_ilock_class#3){++++}-{3:3}, at: xfs_can_free_eofblocks+0x5f1/0x8d0 fs/xfs/xfs_bmap_util.c:550

but task is already holding lock:
ffffffff8e82e3a0 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat mm/vmscan.c:6841 [inline]
ffffffff8e82e3a0 (fs_reclaim){+.+.}-{0:0}, at: kswapd+0xb06/0x2e80 mm/vmscan.c:7223

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:5759
       __fs_reclaim_acquire mm/page_alloc.c:3823 [inline]
       fs_reclaim_acquire+0x88/0x140 mm/page_alloc.c:3837
       might_alloc include/linux/sched/mm.h:334 [inline]
       slab_pre_alloc_hook mm/slub.c:3939 [inline]
       slab_alloc_node mm/slub.c:4017 [inline]
       __do_kmalloc_node mm/slub.c:4157 [inline]
       __kmalloc_noprof+0xa9/0x400 mm/slub.c:4170
       kmalloc_noprof include/linux/slab.h:685 [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:341
       ovl_copy_xattr+0x1a2/0xb60 fs/overlayfs/copy_up.c:98
       ovl_copy_up_metadata+0x24f/0xda0 fs/overlayfs/copy_up.c:650
       ovl_copy_up_tmpfile fs/overlayfs/copy_up.c:870 [inline]
       ovl_do_copy_up fs/overlayfs/copy_up.c:976 [inline]
       ovl_copy_up_one fs/overlayfs/copy_up.c:1168 [inline]
       ovl_copy_up_flags+0x1eba/0x4470 fs/overlayfs/copy_up.c:1223
       ovl_open+0x142/0x2a0 fs/overlayfs/file.c:154
       do_dentry_open+0x970/0x1440 fs/open.c:959
       vfs_open+0x3e/0x330 fs/open.c:1089
       do_open fs/namei.c:3727 [inline]
       path_openat+0x2b3e/0x3470 fs/namei.c:3886
       do_filp_open+0x235/0x490 fs/namei.c:3913
       do_sys_openat2+0x13e/0x1d0 fs/open.c:1416
       do_sys_open fs/open.c:1431 [inline]
       __do_sys_openat fs/open.c:1447 [inline]
       __se_sys_openat fs/open.c:1442 [inline]
       __x64_sys_openat+0x247/0x2a0 fs/open.c:1442
       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

-> #0 (&xfs_nondir_ilock_class#3){++++}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3133 [inline]
       check_prevs_add kernel/locking/lockdep.c:3252 [inline]
       validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3868
       __lock_acquire+0x137a/0x2040 kernel/locking/lockdep.c:5142
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5759
       down_read_nested+0xb5/0xa50 kernel/locking/rwsem.c:1651
       xfs_can_free_eofblocks+0x5f1/0x8d0 fs/xfs/xfs_bmap_util.c:550
       xfs_inode_mark_reclaimable+0x1bb/0xf60 fs/xfs/xfs_icache.c:2148
       destroy_inode fs/inode.c:313 [inline]
       evict+0x809/0x950 fs/inode.c:729
       dispose_list fs/inode.c:747 [inline]
       prune_icache_sb+0x239/0x2f0 fs/inode.c:932
       super_cache_scan+0x38c/0x4b0 fs/super.c:223
       do_shrink_slab+0x701/0x1160 mm/shrinker.c:435
       shrink_slab_memcg mm/shrinker.c:548 [inline]
       shrink_slab+0x878/0x14d0 mm/shrinker.c:626
       shrink_node_memcgs mm/vmscan.c:5910 [inline]
       shrink_node+0x130f/0x2df0 mm/vmscan.c:5948
       kswapd_shrink_node mm/vmscan.c:6762 [inline]
       balance_pgdat mm/vmscan.c:6954 [inline]
       kswapd+0x191b/0x2e80 mm/vmscan.c:7223
       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_nondir_ilock_class#3);
                               lock(fs_reclaim);
  rlock(&xfs_nondir_ilock_class#3);

 *** DEADLOCK ***

2 locks held by kswapd0/90:
 #0: ffffffff8e82e3a0 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat mm/vmscan.c:6841 [inline]
 #0: ffffffff8e82e3a0 (fs_reclaim){+.+.}-{0:0}, at: kswapd+0xb06/0x2e80 mm/vmscan.c:7223
 #1: ffff8880656d60e0 (&type->s_umount_key#56){++++}-{3:3}, at: super_trylock_shared fs/super.c:562 [inline]
 #1: ffff8880656d60e0 (&type->s_umount_key#56){++++}-{3:3}, at: super_cache_scan+0x94/0x4b0 fs/super.c:196

stack backtrace:
CPU: 1 UID: 0 PID: 90 Comm: kswapd0 Not tainted 6.11.0-rc3-syzkaller-00279-ge5fa841af679 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:93 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119
 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2186
 check_prev_add kernel/locking/lockdep.c:3133 [inline]
 check_prevs_add kernel/locking/lockdep.c:3252 [inline]
 validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3868
 __lock_acquire+0x137a/0x2040 kernel/locking/lockdep.c:5142
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5759
 down_read_nested+0xb5/0xa50 kernel/locking/rwsem.c:1651
 xfs_can_free_eofblocks+0x5f1/0x8d0 fs/xfs/xfs_bmap_util.c:550
 xfs_inode_mark_reclaimable+0x1bb/0xf60 fs/xfs/xfs_icache.c:2148
 destroy_inode fs/inode.c:313 [inline]
 evict+0x809/0x950 fs/inode.c:729
 dispose_list fs/inode.c:747 [inline]
 prune_icache_sb+0x239/0x2f0 fs/inode.c:932
 super_cache_scan+0x38c/0x4b0 fs/super.c:223
 do_shrink_slab+0x701/0x1160 mm/shrinker.c:435
 shrink_slab_memcg mm/shrinker.c:548 [inline]
 shrink_slab+0x878/0x14d0 mm/shrinker.c:626
 shrink_node_memcgs mm/vmscan.c:5910 [inline]
 shrink_node+0x130f/0x2df0 mm/vmscan.c:5948
 kswapd_shrink_node mm/vmscan.c:6762 [inline]
 balance_pgdat mm/vmscan.c:6954 [inline]
 kswapd+0x191b/0x2e80 mm/vmscan.c:7223
 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 (152):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/08/18 00:27 upstream e5fa841af679 dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in xfs_can_free_eofblocks
2024/12/05 05:27 upstream feffde684ac2 29f61fce .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/12/04 03:04 upstream ceb8bf2ceaa7 b50eb251 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/11/30 11:50 upstream 2ba9f676d0a2 68914665 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/11/30 02:15 upstream 7af08b57bcb9 b5d2be89 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/11/28 22:54 upstream 65ae975e97d5 5df23865 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/11/28 08:19 upstream b86545e02e8c 5df23865 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/11/27 23:19 upstream aaf20f870da0 5df23865 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/11/27 08:08 upstream 445d9f05fa14 52b38cc1 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/11/22 10:12 upstream 28eb75e178d3 4b25d554 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/18 01:12 upstream 6efbea77b390 666f77ed .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/16 16:14 upstream 2f87d0916ce0 bde2d81c .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/16 08:04 upstream 2f87d0916ce0 bde2d81c .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/16 02:44 upstream 2f87d0916ce0 bde2d81c .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/15 02:18 upstream eca631b8fe80 484e362f .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/14 16:02 upstream 6485cf5ea253 084d8178 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/14 11:15 upstream 6485cf5ea253 084d8178 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/13 13:58 upstream 7234e2ea0edd 084d8178 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/13 08:22 upstream 7234e2ea0edd 084d8178 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/11 05:46 upstream 1d227fcc7222 cd942402 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/10 07:10 upstream b983b271662b 0278d004 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/10 02:30 upstream b983b271662b 0278d004 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/09 20:09 upstream 75b607fab38d 56fb2cb7 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/06 05:27 upstream fc20a3e57247 d7906eff .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/06 00:07 upstream fc20a3e57247 d7906eff .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/05 10:01 upstream 27cc6fdf7201 d7906eff .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/05 06:42 upstream 27cc6fdf7201 d7906eff .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/05 01:31 upstream 0c559323bbaa d7906eff .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/04 11:23 upstream 3840cbe24cf0 d7906eff .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/04 09:16 upstream 3840cbe24cf0 d7906eff .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/03 15:40 upstream 7ec462100ef9 d7906eff .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/02 16:01 upstream e32cde8d2bd7 83a2f15f .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/01 21:20 upstream e32cde8d2bd7 e9f6e118 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/01 18:20 upstream e32cde8d2bd7 e9f6e118 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/01 06:41 upstream e32cde8d2bd7 bbd4e0a4 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/10/01 01:21 upstream e32cde8d2bd7 bbd4e0a4 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/09/30 05:07 upstream e7ed34365879 ba29ff75 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/09/29 05:36 upstream 3efc57369a0c ba29ff75 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/09/28 01:32 upstream e477dba5442c 440b26ec .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/09/26 15:29 upstream 11a299a7933e 9314348a .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/09/25 05:56 upstream 68e5c7d4cefb 349a68c4 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/09/25 03:55 upstream 68e5c7d4cefb 349a68c4 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/09/23 14:55 upstream de5cb0dcb74c 49f9c2d2 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/09/23 13:44 upstream de5cb0dcb74c 49f9c2d2 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/08/20 17:12 upstream 6e4436539ae1 9f0ab3fb .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/08/20 16:18 upstream 6e4436539ae1 9f0ab3fb .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/08/18 11:26 upstream c3f2d783a459 e1c76ab2 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/08/17 10:01 upstream e5fa841af679 e1c76ab2 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/08/17 09:32 upstream e5fa841af679 e1c76ab2 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/08/16 03:33 upstream d7a5aa4b3c00 e4bacdaf .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/08/14 19:12 upstream 6b0f8db921ab 890d2dda .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/08/14 16:19 upstream 6b0f8db921ab 890d2dda .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
2024/08/14 13:43 upstream 6b0f8db921ab 890d2dda .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root possible deadlock in xfs_can_free_eofblocks
* Struck through repros no longer work on HEAD.