syzbot


WARNING in btrfs_free_reserved_data_space_noquota

Status: upstream: reported C repro on 2022/11/29 08:43
Labels: btrfs (incorrect?)
Reported-by: syzbot+adec8406ad17413d4c06@syzkaller.appspotmail.com
First crash: 185d, last: 8d09h

Cause bisection: introduced by (bisect log) :
commit c814bf958926ff45a9c1e899bd001006ab6cfbae
Author: ye xingchen <ye.xingchen@zte.com.cn>
Date: Tue Aug 16 10:51:06 2022 +0000

  powerpc/selftests: Use timersub() for gettimeofday()

Crash: kernel BUG in close_ctree (log)
Repro: C syz .config
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] WARNING in btrfs_free_reserved_data_space_noquota 1 (2) 2022/11/30 10:35
Fix bisection attempts (4)
Created Duration User Patch Repo Result
2023/05/25 05:54 25m bisect fix upstream job log (0) log
2023/04/25 05:00 52m bisect fix upstream job log (0) log
2023/03/14 01:35 1h10m bisect fix upstream job log (0) log
2023/02/12 00:49 41m bisect fix upstream job log (0) log

Sample crash report:
RSP: 002b:00007ffde59e4cb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000148
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f9a61e8dec9
RDX: 0000000000000001 RSI: 0000000020000280 RDI: 0000000000000005
RBP: 00007ffde59e4cf0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000008000000 R11: 0000000000000246 R12: 0000000000000006
R13: 00007ffde59e4d30 R14: 00007ffde59e4d10 R15: 0000000000000003
 </TASK>
------------[ cut here ]------------
WARNING: CPU: 1 PID: 5147 at fs/btrfs/space-info.h:197 btrfs_space_info_free_bytes_may_use fs/btrfs/space-info.h:229 [inline]
WARNING: CPU: 1 PID: 5147 at fs/btrfs/space-info.h:197 btrfs_free_reserved_data_space_noquota+0x2c5/0x4c0 fs/btrfs/delalloc-space.c:181
Modules linked in:
CPU: 1 PID: 5147 Comm: syz-executor294 Not tainted 6.3.0-rc3-syzkaller-00322-g4bdec23f971b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
RIP: 0010:btrfs_space_info_update_bytes_may_use fs/btrfs/space-info.h:197 [inline]
RIP: 0010:btrfs_space_info_free_bytes_may_use fs/btrfs/space-info.h:229 [inline]
RIP: 0010:btrfs_free_reserved_data_space_noquota+0x2c5/0x4c0 fs/btrfs/delalloc-space.c:181
Code: 2d 00 00 74 08 4c 89 ff e8 88 3c 38 fe 4d 8b 27 4c 89 e7 48 8b 5c 24 18 48 89 de e8 d5 87 e2 fd 49 39 dc 73 13 e8 bb 85 e2 fd <0f> 0b 31 db 41 80 7c 2d 00 00 75 8b eb 91 e8 a8 85 e2 fd 41 80 7c
RSP: 0018:ffffc9000407f408 EFLAGS: 00010293
RAX: ffffffff83a7e765 RBX: 0000000000800000 RCX: ffff888029b68000
RDX: 0000000000000000 RSI: 0000000000800000 RDI: 00000000005cb000
RBP: dffffc0000000000 R08: ffffffff83a7e75b R09: fffffbfff1ca6f0e
R10: 0000000000000000 R11: dffffc0000000001 R12: 00000000005cb000
R13: 1ffff110055d090c R14: ffff88802859c000 R15: ffff88802ae84860
FS:  00005555572df300(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f9a61f05140 CR3: 000000002092b000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 btrfs_free_reserved_data_space+0xa2/0xe0 fs/btrfs/delalloc-space.c:201
 btrfs_dio_iomap_begin+0x852/0xf20 fs/btrfs/inode.c:7695
 iomap_iter+0x677/0xec0 fs/iomap/iter.c:91
 __iomap_dio_rw+0xd74/0x20d0 fs/iomap/direct-io.c:594
 btrfs_dio_write+0xbc/0x110 fs/btrfs/inode.c:7803
 btrfs_direct_write fs/btrfs/file.c:1529 [inline]
 btrfs_do_write_iter+0x86f/0x1270 fs/btrfs/file.c:1674
 do_iter_write+0x6ea/0xc50 fs/read_write.c:861
 vfs_writev fs/read_write.c:934 [inline]
 do_pwritev+0x21a/0x360 fs/read_write.c:1031
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f9a61e8dec9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 15 00 00 90 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffde59e4cb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000148
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f9a61e8dec9
RDX: 0000000000000001 RSI: 0000000020000280 RDI: 0000000000000005
RBP: 00007ffde59e4cf0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000008000000 R11: 0000000000000246 R12: 0000000000000006
R13: 00007ffde59e4d30 R14: 00007ffde59e4d10 R15: 0000000000000003
 </TASK>

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Manager Title
2023/03/26 04:59 upstream 4bdec23f971b fbf0499a .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-smack-root WARNING in btrfs_free_reserved_data_space_noquota
2022/11/28 19:36 upstream b7b275e60bcd 247de55b .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs WARNING in btrfs_free_reserved_data_space_noquota
2023/01/13 00:49 linux-next 0a093b2893c7 96166539 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-linux-next-kasan-gce-root WARNING in btrfs_free_reserved_data_space_noquota
* Struck through repros no longer work on HEAD.