syzbot


WARNING in btrfs_free_reserved_data_space_noquota

Status: upstream: reported C repro on 2022/11/29 08:43
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+adec8406ad17413d4c06@syzkaller.appspotmail.com
First crash: 371d, last: 9d07h
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
  
Fix bisection: fixed by (bisect log) :
commit 487c20b016dc48230367a7be017f40313e53e3bd
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Thu Mar 30 21:53:51 2023 +0000

  iov: improve copy_iovec_from_user() code generation

  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] WARNING in btrfs_free_reserved_data_space_noquota 1 (3) 2023/08/01 09:27
Last patch testing requests (4)
Created Duration User Patch Repo Result
2023/11/16 00:49 19m retest repro linux-next report log
2023/11/03 05:43 19m retest repro upstream OK log
2023/09/06 04:04 16m retest repro linux-next report log
2023/08/25 05:04 38m retest repro upstream report log
Fix bisection attempts (6)
Created Duration User Patch Repo Result
2023/08/01 05:04 4h21m bisect fix upstream job log (1)
2023/06/24 16:58 26m bisect fix upstream job log (0) log
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:
RAX: ffffffffffffffda RBX: 00007ffe7f0fdb20 RCX: 00007f8c263a9329
RDX: 000000000000000d RSI: 0000000020000240 RDI: 0000000000000004
RBP: 0000000000000001 R08: 0000000000000408 R09: 0000000000000010
R10: 0000000000001400 R11: 0000000000000246 R12: 00007ffe7f0fdb1c
R13: 0000000000000006 R14: 431bde82d7b634db R15: 00007ffe7f0fdb60
 </TASK>
------------[ cut here ]------------
WARNING: CPU: 0 PID: 5162 at fs/btrfs/space-info.h:199 btrfs_space_info_update_bytes_may_use fs/btrfs/space-info.h:199 [inline]
WARNING: CPU: 0 PID: 5162 at fs/btrfs/space-info.h:199 btrfs_space_info_free_bytes_may_use fs/btrfs/space-info.h:231 [inline]
WARNING: CPU: 0 PID: 5162 at fs/btrfs/space-info.h:199 btrfs_free_reserved_data_space_noquota+0x2c1/0x4d0 fs/btrfs/delalloc-space.c:181
Modules linked in:
CPU: 0 PID: 5162 Comm: syz-executor168 Not tainted 6.7.0-rc2-syzkaller-00195-g0f5cc96c367f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
RIP: 0010:btrfs_space_info_update_bytes_may_use fs/btrfs/space-info.h:199 [inline]
RIP: 0010:btrfs_space_info_free_bytes_may_use fs/btrfs/space-info.h:231 [inline]
RIP: 0010:btrfs_free_reserved_data_space_noquota+0x2c1/0x4d0 fs/btrfs/delalloc-space.c:181
Code: 00 00 74 08 4c 89 ff e8 ad 92 32 fe 4d 8b 27 4c 89 e7 48 8b 5c 24 18 48 89 de e8 0a 8d d6 fd 49 39 dc 73 15 e8 f0 8a d6 fd 90 <0f> 0b 90 31 db 41 80 7c 2d 00 00 75 89 eb 8f e8 db 8a d6 fd 41 80
RSP: 0018:ffffc90004377368 EFLAGS: 00010293
RAX: ffffffff83b7ee90 RBX: 0000000000800000 RCX: ffff88807e91bb80
RDX: 0000000000000000 RSI: 0000000000800000 RDI: 000000000067d000
RBP: dffffc0000000000 R08: ffffffff83b7ee86 R09: 1ffffffff1e0186d
R10: dffffc0000000000 R11: fffffbfff1e0186e R12: 000000000067d000
R13: 1ffff11004132c0c R14: ffff88807f0e8000 R15: ffff888020996060
FS:  00005555563fa380(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f8c264260f8 CR3: 00000000270db000 CR4: 00000000003506f0
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+0x908/0x10b0 fs/btrfs/inode.c:7660
 iomap_iter+0x677/0xee0 fs/iomap/iter.c:91
 __iomap_dio_rw+0xdcf/0x2330 fs/iomap/direct-io.c:658
 btrfs_dio_write+0xb6/0x100 fs/btrfs/inode.c:7798
 btrfs_direct_write fs/btrfs/file.c:1543 [inline]
 btrfs_do_write_iter+0x7ac/0x1190 fs/btrfs/file.c:1684
 do_iter_readv_writev+0x330/0x4a0
 do_iter_write+0x1f6/0x8d0 fs/read_write.c:860
 vfs_writev fs/read_write.c:933 [inline]
 do_pwritev+0x21a/0x360 fs/read_write.c:1030
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x45/0x110 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7f8c263a9329
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 21 18 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe7f0fdae8 EFLAGS: 00000246 ORIG_RAX: 0000000000000148
RAX: ffffffffffffffda RBX: 00007ffe7f0fdb20 RCX: 00007f8c263a9329
RDX: 000000000000000d RSI: 0000000020000240 RDI: 0000000000000004
RBP: 0000000000000001 R08: 0000000000000408 R09: 0000000000000010
R10: 0000000000001400 R11: 0000000000000246 R12: 00007ffe7f0fdb1c
R13: 0000000000000006 R14: 431bde82d7b634db R15: 00007ffe7f0fdb60
 </TASK>

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/11/25 13:21 upstream 0f5cc96c367f 5b429f39 .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/11/25 11:06 upstream 0f5cc96c367f 5b429f39 .config console log report syz C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-qemu-upstream 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
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/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
2023/11/25 10:56 upstream 0f5cc96c367f 5b429f39 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING in btrfs_free_reserved_data_space_noquota
* Struck through repros no longer work on HEAD.