syzbot


INFO: task hung in extent_writepages (2)

Status: auto-obsoleted due to no activity on 2024/08/18 00:52
Reported-by: syzbot+efdf78ceb0e39f2a1702@syzkaller.appspotmail.com
First crash: 197d, last: 197d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 INFO: task hung in extent_writepages 3 172d 199d 0/3 auto-obsoleted due to no activity on 2024/09/11 18:05
linux-6.1 INFO: task hung in extent_writepages (2) 1 22d 22d 0/3 upstream: reported on 2024/10/31 22:43
upstream INFO: task hung in extent_writepages btrfs C inconclusive done 30 290d 478d 0/28 auto-obsoleted due to no activity on 2024/05/17 02:53
linux-5.15 INFO: task hung in extent_writepages 1 579d 579d 0/3 auto-obsoleted due to no activity on 2023/08/22 08:46

Sample crash report:
INFO: task kworker/u4:1:144 blocked for more than 143 seconds.
      Not tainted 5.15.158-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u4:1    state:D stack:20416 pid:  144 ppid:     2 flags:0x00004000
Workqueue: writeback wb_workfn (flush-btrfs-117)
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5030 [inline]
 __schedule+0x12c4/0x45b0 kernel/sched/core.c:6376
 schedule+0x11b/0x1f0 kernel/sched/core.c:6459
 io_schedule+0x88/0x100 kernel/sched/core.c:8484
 wait_on_page_bit_common+0xa13/0x1180 mm/filemap.c:1356
 lock_page include/linux/pagemap.h:625 [inline]
 extent_write_cache_pages fs/btrfs/extent_io.c:5008 [inline]
 extent_writepages+0x8fb/0x1590 fs/btrfs/extent_io.c:5157
 do_writepages+0x481/0x730 mm/page-writeback.c:2364
 __writeback_single_inode+0x15b/0xe30 fs/fs-writeback.c:1647
 writeback_sb_inodes+0xbce/0x1a40 fs/fs-writeback.c:1930
 __writeback_inodes_wb+0x114/0x400 fs/fs-writeback.c:2001
 wb_writeback+0x465/0xc50 fs/fs-writeback.c:2106
 wb_check_background_flush fs/fs-writeback.c:2172 [inline]
 wb_do_writeback fs/fs-writeback.c:2260 [inline]
 wb_workfn+0xd07/0x1130 fs/fs-writeback.c:2288
 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
 kthread+0x3f6/0x4f0 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300
 </TASK>
INFO: task syz-executor.4:23366 blocked for more than 144 seconds.
      Not tainted 5.15.158-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.4  state:D stack:26904 pid:23366 ppid: 22769 flags:0x00004006
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5030 [inline]
 __schedule+0x12c4/0x45b0 kernel/sched/core.c:6376
 schedule+0x11b/0x1f0 kernel/sched/core.c:6459
 wait_on_state fs/btrfs/extent_io.c:868 [inline]
 wait_extent_bit+0x3f9/0x530 fs/btrfs/extent_io.c:906
 lock_extent_bits fs/btrfs/extent_io.c:1469 [inline]
 find_lock_delalloc_range+0x469/0x8f0 fs/btrfs/extent_io.c:2047
 writepage_delalloc+0x1a0/0x5a0 fs/btrfs/extent_io.c:3795
 __extent_writepage+0x57d/0xbc0 fs/btrfs/extent_io.c:4108
 extent_write_cache_pages fs/btrfs/extent_io.c:5030 [inline]
 extent_writepages+0xbbd/0x1590 fs/btrfs/extent_io.c:5157
 do_writepages+0x481/0x730 mm/page-writeback.c:2364
 filemap_fdatawrite_wbc+0x1d6/0x230 mm/filemap.c:400
 __filemap_fdatawrite_range mm/filemap.c:433 [inline]
 __filemap_fdatawrite mm/filemap.c:439 [inline]
 filemap_flush+0x10c/0x150 mm/filemap.c:466
 btrfs_release_file+0x102/0x120 fs/btrfs/file.c:2119
 __fput+0x3bf/0x890 fs/file_table.c:280
 task_work_run+0x129/0x1a0 kernel/task_work.c:164
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214
 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
 syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307
 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f8358bc2c5a
RSP: 002b:00007ffe63993740 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000007 RCX: 00007f8358bc2c5a
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000006
RBP: 00007f8358cf3980 R08: 0000001b32120000 R09: 000000000000007f
R10: 0000000081840e9d R11: 0000000000000293 R12: 00000000000d3066
R13: 00007f8358cf205c R14: 00007ffe63993840 R15: 0000000000000032
 </TASK>
INFO: task syz-executor.4:23367 blocked for more than 145 seconds.
      Not tainted 5.15.158-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.4  state:D stack:23264 pid:23367 ppid: 22769 flags:0x00004006
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5030 [inline]
 __schedule+0x12c4/0x45b0 kernel/sched/core.c:6376
 schedule+0x11b/0x1f0 kernel/sched/core.c:6459
 wait_on_state fs/btrfs/extent_io.c:868 [inline]
 wait_extent_bit+0x3f9/0x530 fs/btrfs/extent_io.c:906
 lock_extent_bits+0x10d/0x1e0 fs/btrfs/extent_io.c:1469
 btrfs_lock_and_flush_ordered_range+0xcf/0x230 fs/btrfs/ordered-data.c:1029
 contiguous_readpages fs/btrfs/extent_io.c:3756 [inline]
 extent_readahead+0xe27/0x1660 fs/btrfs/extent_io.c:5181
 read_pages+0x159/0x8e0 mm/readahead.c:130
 page_cache_ra_unbounded+0x7b0/0x930 mm/readahead.c:239
 do_sync_mmap_readahead+0x610/0x800 mm/filemap.c:2996
 filemap_fault+0x77a/0x1470 mm/filemap.c:3089
 __do_fault+0x139/0x340 mm/memory.c:3898
 do_read_fault mm/memory.c:4234 [inline]
 do_fault mm/memory.c:4362 [inline]
 handle_pte_fault mm/memory.c:4621 [inline]
 __handle_mm_fault mm/memory.c:4756 [inline]
 handle_mm_fault+0x376f/0x5950 mm/memory.c:4854
 faultin_page mm/gup.c:976 [inline]
 __get_user_pages+0x4ed/0x11d0 mm/gup.c:1197
 populate_vma_page_range+0x215/0x2a0 mm/gup.c:1529
 __mm_populate+0x2a5/0x4a0 mm/gup.c:1638
 mm_populate include/linux/mm.h:2632 [inline]
 vm_mmap_pgoff+0x22b/0x2d0 mm/util.c:556
 ksys_mmap_pgoff+0x559/0x780 mm/mmap.c:1624
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f8358bc3d69
RSP: 002b:00007f83571360c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 00007f8358cf1f80 RCX: 00007f8358bc3d69
RDX: 00000000027fffff RSI: 0000000000600000 RDI: 0000000020000000
RBP: 00007f8358c1049e R08: 0000000000000005 R09: 0000000000000000
R10: 0000000004002011 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f8358cf1f80 R15: 00007ffe63993678
 </TASK>
INFO: task syz-executor.4:23422 blocked for more than 145 seconds.
      Not tainted 5.15.158-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.4  state:D stack:25272 pid:23422 ppid: 22769 flags:0x00004006
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5030 [inline]
 __schedule+0x12c4/0x45b0 kernel/sched/core.c:6376
 schedule+0x11b/0x1f0 kernel/sched/core.c:6459
 io_schedule+0x88/0x100 kernel/sched/core.c:8484
 wait_on_page_bit_common+0xa13/0x1180 mm/filemap.c:1356
 lock_page include/linux/pagemap.h:625 [inline]
 btrfs_page_mkwrite+0x537/0xd60 fs/btrfs/inode.c:8943
 do_page_mkwrite+0x1a9/0x440 mm/memory.c:2892
 wp_page_shared+0x179/0x690 mm/memory.c:3229
 handle_pte_fault mm/memory.c:4639 [inline]
 __handle_mm_fault mm/memory.c:4756 [inline]
 handle_mm_fault+0x2a3d/0x5950 mm/memory.c:4854
 do_user_addr_fault arch/x86/mm/fault.c:1388 [inline]
 handle_page_fault arch/x86/mm/fault.c:1476 [inline]
 exc_page_fault+0x271/0x740 arch/x86/mm/fault.c:1532
 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568
RIP: 0010:copy_user_generic_unrolled+0x89/0xc0 arch/x86/lib/copy_user_64.S:92
Code: 38 4c 89 47 20 4c 89 4f 28 4c 89 57 30 4c 89 5f 38 48 8d 76 40 48 8d 7f 40 ff c9 75 b6 89 d1 83 e2 07 c1 e9 03 74 12 4c 8b 06 <4c> 89 07 48 8d 76 08 48 8d 7f 08 ff c9 75 ee 21 d2 74 10 89 d1 8a
RSP: 0018:ffffc90003307668 EFLAGS: 00050202
RAX: ffffffff8408e401 RBX: 0000000020000098 RCX: 0000000000000007
RDX: 0000000000000000 RSI: ffffc90003307720 RDI: 0000000020000060
RBP: ffffc900033077d0 R08: 0000000000000000 R09: fffff52000660eeb
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000038
R13: 00007ffffffff000 R14: ffffc90003307720 R15: 0000000020000060
 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline]
 raw_copy_to_user arch/x86/include/asm/uaccess_64.h:58 [inline]
 _copy_to_user+0xef/0x130 lib/usercopy.c:40
 copy_to_user include/linux/uaccess.h:200 [inline]
 fiemap_fill_next_extent+0x231/0x410 fs/ioctl.c:144
 emit_fiemap_extent fs/btrfs/extent_io.c:5461 [inline]
 extent_fiemap+0x1218/0x1650 fs/btrfs/extent_io.c:5687
 btrfs_fiemap+0x121/0x160 fs/btrfs/inode.c:8576
 ioctl_fiemap fs/ioctl.c:219 [inline]
 do_vfs_ioctl+0x1934/0x2b70 fs/ioctl.c:814
 __do_sys_ioctl fs/ioctl.c:872 [inline]
 __se_sys_ioctl+0x81/0x160 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f8358bc3d69
RSP: 002b:00007f83571150c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f8358cf2050 RCX: 00007f8358bc3d69
RDX: 0000000020000040 RSI: 00000000c020660b RDI: 0000000000000004
RBP: 00007f8358c1049e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000006e R14: 00007f8358cf2050 R15: 00007ffe63993678
 </TASK>

Showing all locks held in the system:
1 lock held by ksoftirqd/0/14:
 #0: ffff8880b9a3a358 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:475
1 lock held by khungtaskd/27:
 #0: ffffffff8c91fae0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x0/0x30
3 locks held by kworker/u4:1/144:
 #0: ffff8880145bc938 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x78a/0x10c0 kernel/workqueue.c:2283
 #1: ffffc900011afd20 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x7d0/0x10c0 kernel/workqueue.c:2285
 #2: ffff8880647440e0 (&type->s_umount_key#90){++++}-{3:3}, at: trylock_super+0x1b/0xf0 fs/super.c:418
2 locks held by getty/3266:
 #0: ffff88814a922098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:252
 #1: ffffc90002bab2e8 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x6af/0x1db0 drivers/tty/n_tty.c:2158
3 locks held by kworker/u4:6/4401:
3 locks held by kworker/1:26/14618:
 #0: ffff888011c70938 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x78a/0x10c0 kernel/workqueue.c:2283
 #1: ffffc90003577d20 (fqdir_free_work){+.+.}-{0:0}, at: process_one_work+0x7d0/0x10c0 kernel/workqueue.c:2285
 #2: ffffffff8c923fb0 (rcu_state.barrier_mutex){+.+.}-{3:3}, at: rcu_barrier+0x9c/0x4e0 kernel/rcu/tree.c:4039
1 lock held by syz-executor.4/23367:
 #0: ffff88805f4f9b50 (mapping.invalidate_lock#10){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:844 [inline]
 #0: ffff88805f4f9b50 (mapping.invalidate_lock#10){.+.+}-{3:3}, at: page_cache_ra_unbounded+0x1a6/0x930 mm/readahead.c:195
3 locks held by syz-executor.4/23422:
 #0: ffff88801ed4ab28 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline]
 #0: ffff88801ed4ab28 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1329 [inline]
 #0: ffff88801ed4ab28 (&mm->mmap_lock){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1476 [inline]
 #0: ffff88801ed4ab28 (&mm->mmap_lock){++++}-{3:3}, at: exc_page_fault+0x181/0x740 arch/x86/mm/fault.c:1532
 #1: ffff888064744558 (sb_pagefaults#9){.+.+}-{0:0}, at: do_page_mkwrite+0x1a9/0x440 mm/memory.c:2892
 #2: ffff88805f4f9838 (&ei->i_mmap_lock){++++}-{3:3}, at: btrfs_page_mkwrite+0x4a2/0xd60 fs/btrfs/inode.c:8942
2 locks held by kworker/u4:13/26753:

=============================================

NMI backtrace for cpu 1
CPU: 1 PID: 27 Comm: khungtaskd Not tainted 5.15.158-syzkaller #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+0x1e3/0x2d0 lib/dump_stack.c:106
 nmi_cpu_backtrace+0x46a/0x4a0 lib/nmi_backtrace.c:111
 nmi_trigger_cpumask_backtrace+0x181/0x2a0 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:148 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:210 [inline]
 watchdog+0xe72/0xeb0 kernel/hung_task.c:295
 kthread+0x3f6/0x4f0 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300
 </TASK>
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0 skipped: idling at native_safe_halt arch/x86/include/asm/irqflags.h:51 [inline]
NMI backtrace for cpu 0 skipped: idling at arch_safe_halt arch/x86/include/asm/irqflags.h:89 [inline]
NMI backtrace for cpu 0 skipped: idling at acpi_safe_halt drivers/acpi/processor_idle.c:109 [inline]
NMI backtrace for cpu 0 skipped: idling at acpi_idle_do_entry+0x10f/0x340 drivers/acpi/processor_idle.c:570

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/10 00:51 linux-5.15.y 284087d4f7d5 de979bc2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan INFO: task hung in extent_writepages
* Struck through repros no longer work on HEAD.