syzbot


BUG: sleeping function called from invalid context in gfs2_withdraw (2)

Status: upstream: reported on 2025/09/13 22:07
Subsystems: gfs2
[Documentation on labels]
Reported-by: syzbot+2c1d8759af67dedac957@syzkaller.appspotmail.com
First crash: 62d, last: 20h42m
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [gfs2?] BUG: sleeping function called from invalid context in gfs2_withdraw (2) 0 (1) 2025/09/13 22:07
Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 BUG: sleeping function called from invalid context in gfs2_withdraw 5 1 14d 14d 0/3 upstream: reported on 2025/10/27 10:36
linux-6.1 BUG: sleeping function called from invalid context in gfs2_withdraw origin:upstream 5 C error 15 17d 232d 0/3 upstream: reported C repro on 2025/03/23 18:44
upstream BUG: sleeping function called from invalid context in gfs2_withdraw gfs2 5 C error done 182 672d 793d 25/29 fixed on 2024/03/20 11:33
linux-6.6 BUG: sleeping function called from invalid context in gfs2_withdraw 5 10 10h52m 103d 0/2 upstream: reported on 2025/07/30 20:12

Sample crash report:
loop0: detected capacity change from 0 to 32768
gfs2: fsid=syz:syz: Trying to join cluster "lock_nolock", "syz:syz"
gfs2: fsid=syz:syz: Now mounting FS (format 1801)...
gfs2: fsid=syz:syz.0: journal 0 mapped with 1 extents in 0ms
gfs2: fsid=syz:syz.0: first mount done, others may mount
gfs2: fsid=syz:syz.0: fatal: I/O error - block = 9410, function = gfs2_pin, file = fs/gfs2/lops.c, line = 52
gfs2: fsid=syz:syz.0: about to withdraw this file system
BUG: sleeping function called from invalid context at fs/gfs2/util.c:159
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 5321, name: syz.0.0
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
7 locks held by syz.0.0/5321:
 #0: ffff8880110f60f8 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x247/0x320 fs/file.c:1232
 #1: ffff88803545e420 (sb_writers#12){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:3111 [inline]
 #1: ffff88803545e420 (sb_writers#12){.+.+}-{0:0}, at: vfs_write+0x211/0xb30 fs/read_write.c:682
 #2: ffff888040c6d768 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:980 [inline]
 #2: ffff888040c6d768 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: gfs2_file_write_iter+0x323/0x1100 fs/gfs2/file.c:1117
 #3: ffff88803545e610 (sb_internal#2){.+.+}-{0:0}, at: gfs2_trans_begin+0x6f/0xe0 fs/gfs2/trans.c:118
 #4: ffff88803560ce50 (&sdp->sd_log_flush_lock){++++}-{4:4}, at: __gfs2_trans_begin+0x515/0x890 fs/gfs2/trans.c:87
 #5: ffff88803560cc78 (&sdp->sd_log_lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline]
 #5: ffff88803560cc78 (&sdp->sd_log_lock){+.+.}-{3:3}, at: gfs2_log_lock fs/gfs2/log.h:32 [inline]
 #5: ffff88803560cc78 (&sdp->sd_log_lock){+.+.}-{3:3}, at: gfs2_trans_add_meta+0x156/0xa10 fs/gfs2/trans.c:265
 #6: ffff88803560cfe8 (&sdp->sd_freeze_mutex){+.+.}-{4:4}, at: signal_our_withdraw fs/gfs2/util.c:152 [inline]
 #6: ffff88803560cfe8 (&sdp->sd_freeze_mutex){+.+.}-{4:4}, at: gfs2_withdraw+0x444/0x1430 fs/gfs2/util.c:333
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 0 UID: 0 PID: 5321 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 __might_resched+0x495/0x610 kernel/sched/core.c:8927
 signal_our_withdraw fs/gfs2/util.c:157 [inline]
 gfs2_withdraw+0x492/0x1430 fs/gfs2/util.c:333
 gfs2_pin+0x129/0x380 fs/gfs2/lops.c:52
 gfs2_trans_add_meta+0x693/0xa10 fs/gfs2/trans.c:302
 __gfs2_iomap_alloc+0x263/0x1a30 fs/gfs2/bmap.c:680
 gfs2_iomap_begin_write fs/gfs2/bmap.c:1070 [inline]
 gfs2_iomap_begin+0xaf0/0x11c0 fs/gfs2/bmap.c:1133
 iomap_iter+0x534/0xde0 fs/iomap/iter.c:108
 iomap_file_buffered_write+0x7fa/0x9b0 fs/iomap/buffered-io.c:1070
 gfs2_file_buffered_write+0x4ed/0x880 fs/gfs2/file.c:1061
 gfs2_file_write_iter+0x94e/0x1100 fs/gfs2/file.c:1166
 new_sync_write fs/read_write.c:593 [inline]
 vfs_write+0x5c9/0xb30 fs/read_write.c:686
 ksys_write+0x145/0x250 fs/read_write.c:738
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fd3b9f8f6c9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fd3bad5b038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fd3ba1e5fa0 RCX: 00007fd3b9f8f6c9
RDX: 00000000002a979d RSI: 0000200000000000 RDI: 0000000000000007
RBP: 00007fd3ba011f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fd3ba1e6038 R14: 00007fd3ba1e5fa0 R15: 00007fffc9fc1ef8
 </TASK>
BUG: scheduling while atomic: syz.0.0/5321/0x00000002
7 locks held by syz.0.0/5321:
 #0: ffff8880110f60f8 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x247/0x320 fs/file.c:1232
 #1: ffff88803545e420 (sb_writers#12){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:3111 [inline]
 #1: ffff88803545e420 (sb_writers#12){.+.+}-{0:0}, at: vfs_write+0x211/0xb30 fs/read_write.c:682
 #2: ffff888040c6d768 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:980 [inline]
 #2: ffff888040c6d768 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: gfs2_file_write_iter+0x323/0x1100 fs/gfs2/file.c:1117
 #3: ffff88803545e610 (sb_internal#2){.+.+}-{0:0}, at: gfs2_trans_begin+0x6f/0xe0 fs/gfs2/trans.c:118
 #4: ffff88803560ce50 (&sdp->sd_log_flush_lock){++++}-{4:4}, at: __gfs2_trans_begin+0x515/0x890 fs/gfs2/trans.c:87
 #5: ffff88803560cc78 (&sdp->sd_log_lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline]
 #5: ffff88803560cc78 (&sdp->sd_log_lock){+.+.}-{3:3}, at: gfs2_log_lock fs/gfs2/log.h:32 [inline]
 #5: ffff88803560cc78 (&sdp->sd_log_lock){+.+.}-{3:3}, at: gfs2_trans_add_meta+0x156/0xa10 fs/gfs2/trans.c:265
 #6: ffff88803560cfe8 (&sdp->sd_freeze_mutex){+.+.}-{4:4}, at: signal_our_withdraw fs/gfs2/util.c:152 [inline]
 #6: ffff88803560cfe8 (&sdp->sd_freeze_mutex){+.+.}-{4:4}, at: gfs2_withdraw+0x444/0x1430 fs/gfs2/util.c:333
Modules linked in:
Preemption disabled at:
[<0000000000000000>] 0x0

Crashes (15):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/11/10 11:05 upstream e9a6fb0bcdd7 4e1406b4 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root BUG: sleeping function called from invalid context in gfs2_withdraw
2025/11/09 23:28 upstream 439fc29dfd3b 4e1406b4 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root BUG: sleeping function called from invalid context in gfs2_withdraw
2025/11/07 14:56 upstream 4a0c9b339199 4e1406b4 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root BUG: sleeping function called from invalid context in gfs2_withdraw
2025/11/07 03:03 upstream c2c2ccfd4ba7 4e1406b4 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root BUG: sleeping function called from invalid context in gfs2_withdraw
2025/11/01 23:36 upstream 691d401c7e0e 2c50b6a9 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root BUG: sleeping function called from invalid context in gfs2_withdraw
2025/11/01 22:31 upstream 691d401c7e0e 2c50b6a9 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root BUG: sleeping function called from invalid context in gfs2_withdraw
2025/11/01 22:28 upstream 691d401c7e0e 2c50b6a9 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root BUG: sleeping function called from invalid context in gfs2_withdraw
2025/11/01 22:21 upstream 691d401c7e0e 2c50b6a9 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root BUG: sleeping function called from invalid context in gfs2_withdraw
2025/11/01 12:56 upstream ba36dd5ee6fd 2c50b6a9 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root BUG: sleeping function called from invalid context in gfs2_withdraw
2025/10/17 15:12 upstream 98ac9cc4b445 e18aa505 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root BUG: sleeping function called from invalid context in gfs2_withdraw
2025/10/16 07:23 upstream 7ea30958b305 19568248 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root BUG: sleeping function called from invalid context in gfs2_withdraw
2025/10/15 03:32 upstream 9b332cece987 b6605ba8 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root BUG: sleeping function called from invalid context in gfs2_withdraw
2025/10/12 01:28 upstream 98906f9d850e ff1712fe .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root BUG: sleeping function called from invalid context in gfs2_withdraw
2025/09/10 12:12 upstream 9dd1835ecda5 fdeaa69b .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root BUG: sleeping function called from invalid context in gfs2_withdraw
2025/09/09 21:57 upstream 9dd1835ecda5 fdeaa69b .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root BUG: sleeping function called from invalid context in gfs2_withdraw
* Struck through repros no longer work on HEAD.