syzbot


WARNING in btrfs_issue_discard

Status: fixed on 2024/03/26 17:39
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+4a4f1eba14eb5c3417d1@syzkaller.appspotmail.com
Fix commit: a208b3f132b4 btrfs: don't warn if discard range is not aligned to sector
First crash: 273d, last: 256d
Cause bisection: introduced by (bisect log) :
commit 2b9ac22b12a266eb4fec246a07b504dd4983b16b
Author: Kristian Klausen <kristian@klausen.dk>
Date: Fri Jun 18 11:51:57 2021 +0000

  loop: Fix missing discard support when using LOOP_CONFIGURE

Crash: WARNING in btrfs_issue_discard (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [btrfs?] WARNING in btrfs_issue_discard 1 (2) 2024/01/15 19:15

Sample crash report:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 5071 at fs/btrfs/extent-tree.c:1263 btrfs_issue_discard+0x5ba/0x5e0 fs/btrfs/extent-tree.c:1263
Modules linked in:
CPU: 0 PID: 5071 Comm: syz-executor384 Not tainted 6.7.0-syzkaller-04629-g3e7aeb78ab01 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
RIP: 0010:btrfs_issue_discard+0x5ba/0x5e0 fs/btrfs/extent-tree.c:1263
Code: 3c 30 00 74 08 4c 89 e7 e8 23 51 58 fe 4d 01 2c 24 31 ed 89 e8 48 83 c4 28 5b 41 5c 41 5d 41 5e 41 5f 5d c3 e8 87 be fb fd 90 <0f> 0b 90 4d 01 fd 49 29 dd 49 81 e5 00 fe ff ff 49 89 df e9 74 fa
RSP: 0018:ffffc900043df640 EFLAGS: 00010293
RAX: ffffffff83933039 RBX: 0000000000504200 RCX: ffff888076528000
RDX: 0000000000000000 RSI: 0000000000504018 RDI: 0000000000504200
RBP: ffffc900043df810 R08: ffffffff83932ab8 R09: 1ffff1100516a40e
R10: dffffc0000000000 R11: ffffed100516a40f R12: ffffc900043df760
R13: 000000000018bfe8 R14: ffff88801b14b980 R15: 0000000000504018
FS:  00007f61f8a7e6c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f790f99dae0 CR3: 0000000028f87000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 do_discard_extent fs/btrfs/extent-tree.c:1359 [inline]
 btrfs_discard_extent+0x605/0xa80 fs/btrfs/extent-tree.c:1410
 do_trimming+0x1fd/0x590 fs/btrfs/free-space-cache.c:3673
 trim_no_bitmap+0xd60/0x11d0 fs/btrfs/free-space-cache.c:3797
 btrfs_trim_block_group+0x14f/0x450 fs/btrfs/free-space-cache.c:4037
 btrfs_trim_fs+0x3c7/0x10d0 fs/btrfs/extent-tree.c:6315
 btrfs_ioctl_fitrim+0x5ad/0x610 fs/btrfs/ioctl.c:535
 btrfs_ioctl+0x12b/0xd40 fs/btrfs/ioctl.c:4583
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:871 [inline]
 __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:857
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf5/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7f61f8aef469
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 21 1f 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f61f8a7e168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000040 RCX: 00007f61f8aef469
RDX: 0000000020000080 RSI: 00000000c0185879 RDI: 0000000000000005
RBP: 00007f61f8b95710 R08: 00007f61f8b95718 R09: 00007f61f8b95718
R10: 00007f61f8a7e6c0 R11: 0000000000000246 R12: 00007f61f8b9571c
R13: 000000000000006e R14: 00007ffd9ed8dbf0 R15: 00007ffd9ed8dcd8
 </TASK>

Crashes (9):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/01/12 03:09 upstream 3e7aeb78ab01 dda5a988 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-upstream-fs WARNING in btrfs_issue_discard
2024/01/11 18:40 upstream de927f6c0b07 00f3cc59 .config strace log report syz [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-upstream-fs WARNING in btrfs_issue_discard
2024/01/17 01:32 upstream 052d534373b7 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs WARNING in btrfs_issue_discard
2024/01/12 10:40 upstream 3e7aeb78ab01 dda5a988 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs WARNING in btrfs_issue_discard
2024/01/12 09:59 upstream 3e7aeb78ab01 dda5a988 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs WARNING in btrfs_issue_discard
2024/01/12 02:22 upstream 3e7aeb78ab01 dda5a988 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs WARNING in btrfs_issue_discard
2024/01/11 17:20 upstream de927f6c0b07 00f3cc59 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs WARNING in btrfs_issue_discard
2024/01/29 00:00 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 0802e17d9aca cc4a4020 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING in btrfs_issue_discard
2024/01/28 10:59 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 0802e17d9aca cc4a4020 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING in btrfs_issue_discard
* Struck through repros no longer work on HEAD.