syzbot


INFO: task hung in __writeback_single_inode

Status: upstream: reported on 2023/01/18 22:36
Subsystems: xfs
[Documentation on labels]
Reported-by: syzbot+455750d05e072b5cf5ca@syzkaller.appspotmail.com
First crash: 523d, last: 523d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-49 INFO: task hung in __writeback_single_inode 1 1705d 1705d 0/3 auto-closed as invalid on 2020/02/21 11:34

Sample crash report:
 xfs_map_blocks+0x548/0x940 fs/xfs/xfs_aops.c:422
 xfs_writepage_map fs/xfs/xfs_aops.c:964 [inline]
 xfs_do_writepage+0x422/0x13d0 fs/xfs/xfs_aops.c:1149
 write_cache_pages+0x505/0xd20 mm/page-writeback.c:2257
INFO: task syz-executor.1:7996 blocked for more than 140 seconds.
      Not tainted 4.14.303-syzkaller #0
 xfs_vm_writepages+0x258/0x340 fs/xfs/xfs_aops.c:1188
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
 do_writepages+0xc3/0x240 mm/page-writeback.c:2361
syz-executor.1  D
25784  7996      1 0x00000004
Call Trace:
 __writeback_single_inode+0xda/0x1010 fs/fs-writeback.c:1382
 context_switch kernel/sched/core.c:2811 [inline]
 __schedule+0x88b/0x1de0 kernel/sched/core.c:3387
 writeback_sb_inodes+0x48b/0xd30 fs/fs-writeback.c:1645
 wb_writeback+0x243/0xb80 fs/fs-writeback.c:1820
 wb_do_writeback fs/fs-writeback.c:1952 [inline]
 wb_workfn+0x2bd/0xf50 fs/fs-writeback.c:1988
 process_one_work+0x793/0x14a0 kernel/workqueue.c:2117
 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2251
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:406
 schedule+0x8d/0x1b0 kernel/sched/core.c:3431
XFS (loop1): page discard on page ffffea0001094d80, inode 0x29, offset 1937408.
 wb_wait_for_completion fs/fs-writeback.c:222 [inline]
 wb_wait_for_completion+0x118/0x170 fs/fs-writeback.c:218
XFS (loop1): Internal error XFS_WANT_CORRUPTED_RETURN at line 431 of file fs/xfs/libxfs/xfs_alloc.c.  Caller xfs_alloc_ag_vextent_near+0x17b2/0x2fb0 fs/xfs/libxfs/xfs_alloc.c:1333
CPU: 1 PID: 2818 Comm: kworker/u4:3 Not tainted 4.14.303-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023
Workqueue: writeback wb_workfn (flush-7:1)
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 xfs_error_report fs/xfs/xfs_error.c:320 [inline]
 xfs_error_report+0x98/0xa0 fs/xfs/xfs_error.c:307
 xfs_alloc_fixup_trees+0x425/0x4f0 fs/xfs/libxfs/xfs_alloc.c:446
 xfs_alloc_ag_vextent_near+0x17b2/0x2fb0 fs/xfs/libxfs/xfs_alloc.c:1333
 xfs_alloc_ag_vextent+0x579/0x750 fs/xfs/libxfs/xfs_alloc.c:702
 sync_inodes_sb+0x173/0x880 fs/fs-writeback.c:2447
 xfs_alloc_vextent+0x10b0/0x2010 fs/xfs/libxfs/xfs_alloc.c:2835
 xfs_bmap_btalloc+0x9e5/0x1b20 fs/xfs/libxfs/xfs_bmap.c:3733
 xfs_bmap_alloc+0x107/0x160 fs/xfs/libxfs/xfs_bmap.c:3823
 xfs_bmapi_allocate fs/xfs/libxfs/xfs_bmap.c:4269 [inline]
 xfs_bmapi_write+0xa49/0x1d00 fs/xfs/libxfs/xfs_bmap.c:4592
 xfs_iomap_write_allocate+0x42b/0xa30 fs/xfs/xfs_iomap.c:780
 xfs_map_blocks+0x548/0x940 fs/xfs/xfs_aops.c:422
 xfs_writepage_map fs/xfs/xfs_aops.c:964 [inline]
 xfs_do_writepage+0x422/0x13d0 fs/xfs/xfs_aops.c:1149
 __sync_filesystem fs/sync.c:34 [inline]
 sync_filesystem fs/sync.c:67 [inline]
 sync_filesystem+0x12f/0x230 fs/sync.c:48
 write_cache_pages+0x505/0xd20 mm/page-writeback.c:2257
 xfs_vm_writepages+0x258/0x340 fs/xfs/xfs_aops.c:1188
 generic_shutdown_super+0x70/0x370 fs/super.c:432
 kill_block_super+0x95/0xe0 fs/super.c:1161
 deactivate_locked_super+0x6c/0xd0 fs/super.c:319
 do_writepages+0xc3/0x240 mm/page-writeback.c:2361
 deactivate_super+0x7f/0xa0 fs/super.c:350
 cleanup_mnt+0x186/0x2c0 fs/namespace.c:1183
 __writeback_single_inode+0xda/0x1010 fs/fs-writeback.c:1382
 writeback_sb_inodes+0x48b/0xd30 fs/fs-writeback.c:1645
 task_work_run+0x11f/0x190 kernel/task_work.c:113
 wb_writeback+0x243/0xb80 fs/fs-writeback.c:1820
 tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164
 wb_do_writeback fs/fs-writeback.c:1952 [inline]
 wb_workfn+0x2bd/0xf50 fs/fs-writeback.c:1988
 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
 do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297
 process_one_work+0x793/0x14a0 kernel/workqueue.c:2117
 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2251
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:406
XFS (loop1): page discard on page ffffea0001094dc0, inode 0x29, offset 1941504.
 entry_SYSCALL_64_after_hwframe+0x5e/0xd3
XFS (loop1): Internal error XFS_WANT_CORRUPTED_RETURN at line 431 of file fs/xfs/libxfs/xfs_alloc.c.  Caller xfs_alloc_ag_vextent_near+0x17b2/0x2fb0 fs/xfs/libxfs/xfs_alloc.c:1333
RIP: 0033:0x7fc213c7f537
CPU: 1 PID: 2818 Comm: kworker/u4:3 Not tainted 4.14.303-syzkaller #0
RSP: 002b:00007ffedf7eca68 EFLAGS: 00000246
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023
Workqueue: writeback wb_workfn (flush-7:1)
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 xfs_error_report fs/xfs/xfs_error.c:320 [inline]
 xfs_error_report+0x98/0xa0 fs/xfs/xfs_error.c:307
 xfs_alloc_fixup_trees+0x425/0x4f0 fs/xfs/libxfs/xfs_alloc.c:446
 xfs_alloc_ag_vextent_near+0x17b2/0x2fb0 fs/xfs/libxfs/xfs_alloc.c:1333
 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007fc213c7f537
RDX: 00007ffedf7ecb3a RSI: 000000000000000a RDI: 00007ffedf7ecb30
 xfs_alloc_ag_vextent+0x579/0x750 fs/xfs/libxfs/xfs_alloc.c:702
RBP: 00007ffedf7ecb30 R08: 00000000ffffffff R09: 00007ffedf7ec900
R10: 0000555555e19903 R11: 0000000000000246 R12: 00007fc213cd8b24
 xfs_alloc_vextent+0x10b0/0x2010 fs/xfs/libxfs/xfs_alloc.c:2835
 xfs_bmap_btalloc+0x9e5/0x1b20 fs/xfs/libxfs/xfs_bmap.c:3733
 xfs_bmap_alloc+0x107/0x160 fs/xfs/libxfs/xfs_bmap.c:3823
 xfs_bmapi_allocate fs/xfs/libxfs/xfs_bmap.c:4269 [inline]
 xfs_bmapi_write+0xa49/0x1d00 fs/xfs/libxfs/xfs_bmap.c:4592
R13: 00007ffedf7edbf0 R14: 0000555555e19810 R15: 00007ffedf7edc30

Showing all locks held in the system:
1 lock held by khungtaskd/1532:
 xfs_iomap_write_allocate+0x42b/0xa30 fs/xfs/xfs_iomap.c:780
 #0: 
 (
 xfs_map_blocks+0x548/0x940 fs/xfs/xfs_aops.c:422
tasklist_lock
){.+.+}
, at: [<ffffffff8702d8ce>] debug_show_all_locks+0x7c/0x21a kernel/locking/lockdep.c:4548
 xfs_writepage_map fs/xfs/xfs_aops.c:964 [inline]
 xfs_do_writepage+0x422/0x13d0 fs/xfs/xfs_aops.c:1149
 write_cache_pages+0x505/0xd20 mm/page-writeback.c:2257
2 locks held by syz-executor.1/7996:
 xfs_vm_writepages+0x258/0x340 fs/xfs/xfs_aops.c:1188
 #0: 
 do_writepages+0xc3/0x240 mm/page-writeback.c:2361
 (
 __writeback_single_inode+0xda/0x1010 fs/fs-writeback.c:1382
 writeback_sb_inodes+0x48b/0xd30 fs/fs-writeback.c:1645
 wb_writeback+0x243/0xb80 fs/fs-writeback.c:1820
&type->s_umount_key
 wb_do_writeback fs/fs-writeback.c:1952 [inline]
 wb_workfn+0x2bd/0xf50 fs/fs-writeback.c:1988
#56
){+.+.}
, at: [<ffffffff818783f7>] deactivate_super+0x77/0xa0 fs/super.c:349
 #1: 
 (
 process_one_work+0x793/0x14a0 kernel/workqueue.c:2117
&bdi->wb_switch_rwsem
 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2251
){+.+.}
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:406
XFS (loop1): page discard on page ffffea0001094e00, inode 0x29, offset 1945600.
, at: [<ffffffff8190f186>] bdi_down_write_wb_switch_rwsem fs/fs-writeback.c:338 [inline]
, at: [<ffffffff8190f186>] sync_inodes_sb+0x156/0x880 fs/fs-writeback.c:2445
XFS (loop1): Internal error XFS_WANT_CORRUPTED_RETURN at line 431 of file fs/xfs/libxfs/xfs_alloc.c.  Caller xfs_alloc_ag_vextent_near+0x17b2/0x2fb0 fs/xfs/libxfs/xfs_alloc.c:1333

CPU: 1 PID: 2818 Comm: kworker/u4:3 Not tainted 4.14.303-syzkaller #0
=============================================

Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023
NMI backtrace for cpu 0
Workqueue: writeback wb_workfn (flush-7:1)
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 xfs_error_report fs/xfs/xfs_error.c:320 [inline]
 xfs_error_report+0x98/0xa0 fs/xfs/xfs_error.c:307
 xfs_alloc_fixup_trees+0x425/0x4f0 fs/xfs/libxfs/xfs_alloc.c:446
 xfs_alloc_ag_vextent_near+0x17b2/0x2fb0 fs/xfs/libxfs/xfs_alloc.c:1333
 xfs_alloc_ag_vextent+0x579/0x750 fs/xfs/libxfs/xfs_alloc.c:702
 xfs_alloc_vextent+0x10b0/0x2010 fs/xfs/libxfs/xfs_alloc.c:2835
 xfs_bmap_btalloc+0x9e5/0x1b20 fs/xfs/libxfs/xfs_bmap.c:3733
 xfs_bmap_alloc+0x107/0x160 fs/xfs/libxfs/xfs_bmap.c:3823
 xfs_bmapi_allocate fs/xfs/libxfs/xfs_bmap.c:4269 [inline]
 xfs_bmapi_write+0xa49/0x1d00 fs/xfs/libxfs/xfs_bmap.c:4592
 xfs_iomap_write_allocate+0x42b/0xa30 fs/xfs/xfs_iomap.c:780
 xfs_map_blocks+0x548/0x940 fs/xfs/xfs_aops.c:422
 xfs_writepage_map fs/xfs/xfs_aops.c:964 [inline]
 xfs_do_writepage+0x422/0x13d0 fs/xfs/xfs_aops.c:1149
 write_cache_pages+0x505/0xd20 mm/page-writeback.c:2257
 xfs_vm_writepages+0x258/0x340 fs/xfs/xfs_aops.c:1188
 do_writepages+0xc3/0x240 mm/page-writeback.c:2361
 __writeback_single_inode+0xda/0x1010 fs/fs-writeback.c:1382
 writeback_sb_inodes+0x48b/0xd30 fs/fs-writeback.c:1645
 wb_writeback+0x243/0xb80 fs/fs-writeback.c:1820
 wb_do_writeback fs/fs-writeback.c:1952 [inline]
 wb_workfn+0x2bd/0xf50 fs/fs-writeback.c:1988
 process_one_work+0x793/0x14a0 kernel/workqueue.c:2117
 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2251
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:406
CPU: 0 PID: 1532 Comm: khungtaskd Not tainted 4.14.303-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 nmi_cpu_backtrace.cold+0x57/0x93 lib/nmi_backtrace.c:101
 nmi_trigger_cpumask_backtrace+0x13a/0x180 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:140 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:195 [inline]
 watchdog+0x5b9/0xb40 kernel/hung_task.c:274
XFS (loop1): page discard on page ffffea0001094e40, inode 0x29, offset 1949696.
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:406
Sending NMI from CPU 0 to CPUs 1:
XFS (loop1): Internal error XFS_WANT_CORRUPTED_RETURN at line 431 of file fs/xfs/libxfs/xfs_alloc.c.  Caller xfs_alloc_ag_vextent_near+0x17b2/0x2fb0 fs/xfs/libxfs/xfs_alloc.c:1333
NMI backtrace for cpu 1
CPU: 1 PID: 2818 Comm: kworker/u4:3 Not tainted 4.14.303-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023
Workqueue: writeback wb_workfn (flush-7:1)
task: ffff8880ae6ba4c0 task.stack: ffff8880ae6c0000
RIP: 0010:univ8250_console_write+0x2/0x70 drivers/tty/serial/8250/8250_core.c:593
RSP: 0018:ffff8880ae6c67f8 EFLAGS: 00000097
RAX: ffff8880ae6ba4c0 RBX: ffffffff894879e0 RCX: 00000000000002df
RDX: 0000000000000033 RSI: ffffffff8be8f920 RDI: ffffffff894879e0
RBP: 0000000000000000 R08: ffffffff8b9a61f8 R09: 00000000000c0008
R10: ffff8880ae6bae10 R11: ffff8880ae6ba4c0 R12: ffffffff835b71c0
R13: ffffffff894879f0 R14: dffffc0000000000 R15: 0000000000000033
FS:  0000000000000000(0000) GS:ffff8880ba500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb1c96ca010 CR3: 00000000a183d000 CR4: 00000000003406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 call_console_drivers kernel/printk/printk.c:1727 [inline]
 console_unlock+0x99d/0xf20 kernel/printk/printk.c:2409
 vprintk_emit+0x224/0x620 kernel/printk/printk.c:1925
 vprintk_func+0x58/0x160 kernel/printk/printk_safe.c:409
 printk+0x9e/0xbc kernel/printk/printk.c:1998
 __xfs_printk+0x66/0x8a fs/xfs/xfs_message.c:36
 xfs_alert_tag+0x12a/0x166 fs/xfs/xfs_message.c:94
 xfs_error_report fs/xfs/xfs_error.c:316 [inline]
 xfs_error_report+0x93/0xa0 fs/xfs/xfs_error.c:307
 xfs_alloc_fixup_trees+0x425/0x4f0 fs/xfs/libxfs/xfs_alloc.c:446
 xfs_alloc_ag_vextent_near+0x17b2/0x2fb0 fs/xfs/libxfs/xfs_alloc.c:1333
 xfs_alloc_ag_vextent+0x579/0x750 fs/xfs/libxfs/xfs_alloc.c:702
 xfs_alloc_vextent+0x10b0/0x2010 fs/xfs/libxfs/xfs_alloc.c:2835
 xfs_bmap_btalloc+0x9e5/0x1b20 fs/xfs/libxfs/xfs_bmap.c:3733
 xfs_bmap_alloc+0x107/0x160 fs/xfs/libxfs/xfs_bmap.c:3823
 xfs_bmapi_allocate fs/xfs/libxfs/xfs_bmap.c:4269 [inline]
 xfs_bmapi_write+0xa49/0x1d00 fs/xfs/libxfs/xfs_bmap.c:4592
 xfs_iomap_write_allocate+0x42b/0xa30 fs/xfs/xfs_iomap.c:780
 xfs_map_blocks+0x548/0x940 fs/xfs/xfs_aops.c:422
 xfs_writepage_map fs/xfs/xfs_aops.c:964 [inline]
 xfs_do_writepage+0x422/0x13d0 fs/xfs/xfs_aops.c:1149
 write_cache_pages+0x505/0xd20 mm/page-writeback.c:2257
 xfs_vm_writepages+0x258/0x340 fs/xfs/xfs_aops.c:1188
 do_writepages+0xc3/0x240 mm/page-writeback.c:2361
 __writeback_single_inode+0xda/0x1010 fs/fs-writeback.c:1382
 writeback_sb_inodes+0x48b/0xd30 fs/fs-writeback.c:1645
 wb_writeback+0x243/0xb80 fs/fs-writeback.c:1820
 wb_do_writeback fs/fs-writeback.c:1952 [inline]
 wb_workfn+0x2bd/0xf50 fs/fs-writeback.c:1988
 process_one_work+0x793/0x14a0 kernel/workqueue.c:2117
 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2251
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:406
Code: 23 fe e9 24 ff ff ff 4c 89 f7 e8 3a a9 23 fe eb ae 4c 89 f7 e8 30 a9 23 fe e9 63 ff ff ff 66 66 2e 0f 1f 84 00 00 00 00 00 41 54 <41> 89 d4 55 48 89 f5 53 48 89 fb e8 1e e4 f9 fd 48 8d 7b 42 48 

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/01/18 22:36 linux-4.14.y 97205fccccdc 4620c2d9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 INFO: task hung in __writeback_single_inode
* Struck through repros no longer work on HEAD.