bisecting fixing commit since 521b619acdc8f1f5acdac15b84f81fd9515b2aff building syzkaller on 64069d48f293e0be98d4a78a6f7be23861cc1e06 testing commit 521b619acdc8f1f5acdac15b84f81fd9515b2aff with gcc (GCC) 8.1.0 kernel signature: 3e2905ceb5145de4cf91cb98e751c1f3742dbe369bfbf00a84d5daca8f9ec11e all runs: crashed: BUG: unable to handle kernel NULL pointer dereference in start_transaction testing current HEAD 0477e92881850d44910a7e94fc2c46f96faa131f testing commit 0477e92881850d44910a7e94fc2c46f96faa131f with gcc (GCC) 8.1.0 kernel signature: 7a808505d7c3fe4de9edb5143d395297f6890c1103f2c54299ba4a6d04a95f1e all runs: crashed: BUG: unable to handle kernel NULL pointer dereference in start_transaction revisions tested: 2, total time: 15m49.582362387s (build: 8m34.785102591s, test: 6m53.141178326s) the crash still happens on HEAD commit msg: Linux 5.10-rc7 crash: BUG: unable to handle kernel NULL pointer dereference in start_transaction BUG: kernel NULL pointer dereference, address: 000000000000003a #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 11f4a9067 P4D 11f4a9067 PUD 11f458067 PMD 0 Oops: 0002 [#1] PREEMPT SMP CPU: 1 PID: 11529 Comm: syz-executor.3 Not tainted 5.10.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:arch_atomic_fetch_add arch/x86/include/asm/atomic.h:184 [inline] RIP: 0010:atomic_fetch_add_relaxed include/asm-generic/atomic-instrumented.h:143 [inline] RIP: 0010:__refcount_add include/linux/refcount.h:193 [inline] RIP: 0010:__refcount_inc include/linux/refcount.h:250 [inline] RIP: 0010:refcount_inc include/linux/refcount.h:267 [inline] RIP: 0010:start_transaction+0x6f/0x730 fs/btrfs/transaction.c:541 Code: 89 fc 0f 84 90 00 00 00 80 e7 06 0f 85 62 05 00 00 65 48 8b 04 25 00 70 01 00 4c 8b b8 a0 10 00 00 b8 01 00 00 00 49 8d 7f 38 41 0f c1 47 38 85 c0 0f 84 42 05 00 00 0f 88 f0 03 00 00 83 c0 RSP: 0018:ffffc90005a639e8 EFLAGS: 00010246 RAX: 0000000000000001 RBX: 0000000000000001 RCX: 0000000000000000 RDX: 0000000000000801 RSI: 0000000000000000 RDI: 000000000000003a RBP: ffff88811f530000 R08: 0000000000000001 R09: 0000000000000001 R10: 0000000000000001 R11: 0000000000000003 R12: ffff88811f554000 R13: 0000000000000000 R14: 0000000000000004 R15: 0000000000000002 FS: 00007f20f9deb700(0000) GS:ffff88813bd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000000000003a CR3: 000000011f302000 CR4: 0000000000350ee0 Call Trace: flush_space+0x201/0x650 fs/btrfs/space-info.c:685 priority_reclaim_metadata_space.isra.12+0xab/0x1b0 fs/btrfs/space-info.c:1154 handle_reserve_ticket fs/btrfs/space-info.c:1238 [inline] __reserve_bytes+0x468/0xa70 fs/btrfs/space-info.c:1403 btrfs_reserve_metadata_bytes+0x24/0x1a0 fs/btrfs/space-info.c:1429 btrfs_delalloc_reserve_metadata+0x12d/0x480 fs/btrfs/delalloc-space.c:332 btrfs_buffered_write.isra.33+0x1d0/0x720 fs/btrfs/file.c:1646 __btrfs_direct_write fs/btrfs/file.c:1817 [inline] btrfs_file_write_iter+0x510/0x690 fs/btrfs/file.c:1989 call_write_iter include/linux/fs.h:1903 [inline] do_iter_readv_writev+0x15b/0x1b0 fs/read_write.c:740 do_iter_write+0x7e/0x1b0 fs/read_write.c:866 vfs_writev+0x97/0x280 fs/read_write.c:939 do_pwritev+0x87/0xd0 fs/read_write.c:1036 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45deb9 Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f20f9deac78 EFLAGS: 00000246 ORIG_RAX: 0000000000000128 RAX: ffffffffffffffda RBX: 0000000000026480 RCX: 000000000045deb9 RDX: 0000000000000001 RSI: 00000000200014c0 RDI: 0000000000000006 RBP: 000000000118c018 R08: 0000000000000020 R09: 0000000000000000 R10: 0000000000000002 R11: 0000000000000246 R12: 000000000118bfd4 R13: 00007ffeaaf7ebcf R14: 00007f20f9deb9c0 R15: 000000000118bfd4 Modules linked in: CR2: 000000000000003a ---[ end trace b3f2690e594b51d3 ]--- RIP: 0010:arch_atomic_fetch_add arch/x86/include/asm/atomic.h:184 [inline] RIP: 0010:atomic_fetch_add_relaxed include/asm-generic/atomic-instrumented.h:143 [inline] RIP: 0010:__refcount_add include/linux/refcount.h:193 [inline] RIP: 0010:__refcount_inc include/linux/refcount.h:250 [inline] RIP: 0010:refcount_inc include/linux/refcount.h:267 [inline] RIP: 0010:start_transaction+0x6f/0x730 fs/btrfs/transaction.c:541 Code: 89 fc 0f 84 90 00 00 00 80 e7 06 0f 85 62 05 00 00 65 48 8b 04 25 00 70 01 00 4c 8b b8 a0 10 00 00 b8 01 00 00 00 49 8d 7f 38 41 0f c1 47 38 85 c0 0f 84 42 05 00 00 0f 88 f0 03 00 00 83 c0 RSP: 0018:ffffc90005a639e8 EFLAGS: 00010246 RAX: 0000000000000001 RBX: 0000000000000001 RCX: 0000000000000000 RDX: 0000000000000801 RSI: 0000000000000000 RDI: 000000000000003a RBP: ffff88811f530000 R08: 0000000000000001 R09: 0000000000000001 R10: 0000000000000001 R11: 0000000000000003 R12: ffff88811f554000 R13: 0000000000000000 R14: 0000000000000004 R15: 0000000000000002 FS: 00007f20f9deb700(0000) GS:ffff88813bd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000000000003a CR3: 000000011f302000 CR4: 0000000000350ee0