syzbot


INFO: task hung in btrfs_buffered_write

Status: auto-obsoleted due to no activity on 2024/01/24 05:32
Reported-by: syzbot+887ff0d06f9a83492b83@syzkaller.appspotmail.com
First crash: 347d, last: 347d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 INFO: task hung in btrfs_buffered_write 1 109d 109d 0/3 auto-obsoleted due to no activity on 2024/09/18 15:10
upstream INFO: task hung in btrfs_buffered_write btrfs 14 255d 575d 0/28 auto-obsoleted due to no activity on 2024/04/15 13:23

Sample crash report:
INFO: task syz-executor.5:24969 blocked for more than 143 seconds.
      Not tainted 5.15.135-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.5  state:D stack:23264 pid:24969 ppid:  3557 flags:0x00004006
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5026 [inline]
 __schedule+0x12c4/0x45b0 kernel/sched/core.c:6372
 schedule+0x11b/0x1f0 kernel/sched/core.c:6455
 rwsem_down_write_slowpath+0xebb/0x15c0 kernel/locking/rwsem.c:1157
 __down_write_common kernel/locking/rwsem.c:1284 [inline]
 __down_write kernel/locking/rwsem.c:1293 [inline]
 down_write+0x164/0x170 kernel/locking/rwsem.c:1542
 inode_lock include/linux/fs.h:787 [inline]
 btrfs_inode_lock+0x49/0xd0 fs/btrfs/inode.c:124
 btrfs_buffered_write+0x20f/0x1270 fs/btrfs/file.c:1679
 btrfs_direct_write fs/btrfs/file.c:2038 [inline]
 btrfs_file_write_iter+0x975/0xc60 fs/btrfs/file.c:2086
 call_write_iter include/linux/fs.h:2103 [inline]
 new_sync_write fs/read_write.c:507 [inline]
 vfs_write+0xacf/0xe50 fs/read_write.c:594
 ksys_write+0x1a2/0x2c0 fs/read_write.c:647
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fa6a58a6ae9
RSP: 002b:00007fa6a3e280c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fa6a59c5f80 RCX: 00007fa6a58a6ae9
RDX: 0000000000000128 RSI: 0000000020004400 RDI: 0000000000000004
RBP: 00007fa6a58f247a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007fa6a59c5f80 R15: 00007ffc906836e8
 </TASK>
INFO: task syz-executor.5:24991 blocked for more than 143 seconds.
      Not tainted 5.15.135-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.5  state:D stack:23192 pid:24991 ppid:  3557 flags:0x00004006
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5026 [inline]
 __schedule+0x12c4/0x45b0 kernel/sched/core.c:6372
 schedule+0x11b/0x1f0 kernel/sched/core.c:6455
 io_schedule+0x88/0x100 kernel/sched/core.c:8480
 wait_on_page_bit_common+0xa13/0x1180 mm/filemap.c:1356
 lock_page include/linux/pagemap.h:625 [inline]
 set_page_dirty_lock+0xae/0xe0 mm/page-writeback.c:2633
 bio_set_pages_dirty+0x1f3/0x2c0 block/bio.c:1349
 iomap_dio_bio_iter+0xb8d/0x1540 fs/iomap/direct-io.c:338
 __iomap_dio_rw+0xf9f/0x1f40 fs/iomap/direct-io.c:586
 iomap_dio_rw+0x38/0x80 fs/iomap/direct-io.c:672
 btrfs_direct_read fs/btrfs/file.c:3788 [inline]
 btrfs_file_read_iter+0x3a1/0x6a0 fs/btrfs/file.c:3828
 do_iter_readv_writev+0x594/0x7a0
 do_iter_read+0x1ec/0x760 fs/read_write.c:790
 vfs_readv fs/read_write.c:910 [inline]
 do_preadv+0x211/0x350 fs/read_write.c:1002
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fa6a58a6ae9
RSP: 002b:00007fa6a3e070c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000147
RAX: ffffffffffffffda RBX: 00007fa6a59c6050 RCX: 00007fa6a58a6ae9
RDX: 0000000000000001 RSI: 0000000020000100 RDI: 0000000000000004
RBP: 00007fa6a58f247a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007fa6a59c6050 R15: 00007ffc906836e8
 </TASK>
INFO: task syz-executor.5:24993 blocked for more than 143 seconds.
      Not tainted 5.15.135-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.5  state:D stack:21688 pid:24993 ppid:  3557 flags:0x00004006
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5026 [inline]
 __schedule+0x12c4/0x45b0 kernel/sched/core.c:6372
 schedule+0x11b/0x1f0 kernel/sched/core.c:6455
 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_write_and_wait_range+0x19e/0x280 mm/filemap.c:704
 __iomap_dio_rw+0x897/0x1f40 fs/iomap/direct-io.c:557
 iomap_dio_rw+0x38/0x80 fs/iomap/direct-io.c:672
 btrfs_direct_read fs/btrfs/file.c:3788 [inline]
 btrfs_file_read_iter+0x3a1/0x6a0 fs/btrfs/file.c:3828
 do_iter_readv_writev+0x594/0x7a0
 do_iter_read+0x1ec/0x760 fs/read_write.c:790
 vfs_readv fs/read_write.c:910 [inline]
 do_preadv+0x211/0x350 fs/read_write.c:1002
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fa6a58a6ae9
RSP: 002b:00007fa6a3de60c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000147
RAX: ffffffffffffffda RBX: 00007fa6a59c6120 RCX: 00007fa6a58a6ae9
RDX: 0000000000000001 RSI: 0000000020000100 RDI: 0000000000000004
RBP: 00007fa6a58f247a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007fa6a59c6120 R15: 00007ffc906836e8
 </TASK>

Showing all locks held in the system:
1 lock held by khungtaskd/26:
 #0: ffffffff8c91efe0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x0/0x30
2 locks held by getty/3266:
 #0: ffff88814b458098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:252
 #1: ffffc900020a32e8 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x6af/0x1db0 drivers/tty/n_tty.c:2158
2 locks held by kworker/u4:10/5411:
3 locks held by kworker/u4:17/20319:
 #0: ffff888142d85138 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x78a/0x10c0 kernel/workqueue.c:2283
 #1: ffffc900050dfd20 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x7d0/0x10c0 kernel/workqueue.c:2285
 #2: ffff88807c44e0e0 (&type->s_umount_key#52){++++}-{3:3}, at: trylock_super+0x1b/0xf0 fs/super.c:418
3 locks held by syz-executor.5/24969:
 #0: ffff88807c3d3c70 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x2cb/0x380 fs/file.c:1088
 #1: ffff88807c44e460 (sb_writers#13){.+.+}-{0:0}, at: vfs_write+0x29a/0xe50 fs/read_write.c:590
 #2: ffff888099aede60 (&sb->s_type->i_mutex_key#21){++++}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
 #2: ffff888099aede60 (&sb->s_type->i_mutex_key#21){++++}-{3:3}, at: btrfs_inode_lock+0x49/0xd0 fs/btrfs/inode.c:124
1 lock held by syz-executor.5/24991:
 #0: ffff888099aede60 (&sb->s_type->i_mutex_key#21){++++}-{3:3}, at: inode_lock_shared include/linux/fs.h:797 [inline]
 #0: ffff888099aede60 (&sb->s_type->i_mutex_key#21){++++}-{3:3}, at: btrfs_inode_lock+0x5c/0xd0 fs/btrfs/inode.c:116
1 lock held by syz-executor.5/24993:
 #0: ffff888099aede60 (&sb->s_type->i_mutex_key#21){++++}-{3:3}, at: inode_lock_shared include/linux/fs.h:797 [inline]
 #0: ffff888099aede60 (&sb->s_type->i_mutex_key#21){++++}-{3:3}, at: btrfs_inode_lock+0x5c/0xd0 fs/btrfs/inode.c:116
2 locks held by syz-executor.1/25433:
 #0: ffff88807c44e0e0 (&type->s_umount_key#52){++++}-{3:3}, at: iterate_supers+0xac/0x1e0 fs/super.c:703
 #1: ffff8880238567d8 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: bdi_down_write_wb_switch_rwsem fs/fs-writeback.c:362 [inline]
 #1: ffff8880238567d8 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: sync_inodes_sb+0x274/0xab0 fs/fs-writeback.c:2746
2 locks held by syz-executor.1/25551:
 #0: ffff88807c44e0e0 (&type->s_umount_key#52){++++}-{3:3}, at: iterate_supers+0xac/0x1e0 fs/super.c:703
 #1: ffff8880238567d8 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: bdi_down_write_wb_switch_rwsem fs/fs-writeback.c:362 [inline]
 #1: ffff8880238567d8 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: sync_inodes_sb+0x274/0xab0 fs/fs-writeback.c:2746

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

NMI backtrace for cpu 0
CPU: 0 PID: 26 Comm: khungtaskd Not tainted 5.15.135-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb 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:319
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
 </TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 1226 Comm: kworker/u4:5 Not tainted 5.15.135-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
Workqueue: phy11 ieee80211_iface_work
RIP: 0010:validate_chain+0x5d0/0x58b0 kernel/locking/lockdep.c:3799
Code: be 01 00 00 00 48 8b 84 24 98 00 00 00 48 c7 84 24 00 01 00 00 0e 36 e0 45 49 c7 04 04 00 00 00 00 49 c7 44 04 09 00 00 00 00 <49> c7 44 04 17 00 00 00 00 49 c7 44 04 23 00 00 00 00 41 c6 44 04
RSP: 0018:ffffc9000544ef80 EFLAGS: 00000002
RAX: 1ffff92000a89e10 RBX: ffffffff8fc92760 RCX: ffffffff81633562
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffffff8fbd91c0
RBP: ffffc9000544f230 R08: dffffc0000000000 R09: fffffbfff1f7b239
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff88801d14c708 R14: 0000000000000001 R15: ffffffff8fc92778
FS:  0000000000000000(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000564d40495e98 CR3: 000000001f875000 CR4: 00000000003506e0
Call Trace:
 <NMI>
 </NMI>
 <TASK>
 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5011
 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline]
 _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178
 spin_lock_bh include/linux/spinlock.h:368 [inline]
 cfg80211_bss_update+0x87/0x20d0 net/wireless/scan.c:1757
 cfg80211_inform_single_bss_frame_data net/wireless/scan.c:2484 [inline]
 cfg80211_inform_bss_frame_data+0xa13/0x20f0 net/wireless/scan.c:2517
 ieee80211_bss_info_update+0x7a6/0xc80 net/mac80211/scan.c:190
 ieee80211_rx_bss_info net/mac80211/ibss.c:1123 [inline]
 ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1614 [inline]
 ieee80211_ibss_rx_queued_mgmt+0x175e/0x2af0 net/mac80211/ibss.c:1643
 ieee80211_iface_process_skb net/mac80211/iface.c:1441 [inline]
 ieee80211_iface_work+0x78f/0xcc0 net/mac80211/iface.c:1495
 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
 kthread+0x3f6/0x4f0 kernel/kthread.c:319
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
 </TASK>

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