BTRFS error (device loop0 state EAL): bdev /dev/loop0 errs: wr 10, rd 0, flush 0, corrupt 0, gen 0 assertion failed: folio_test_locked(folio), in fs/btrfs/subpage.c:871 ------------[ cut here ]------------ kernel BUG at fs/btrfs/subpage.c:871! Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI CPU: 0 UID: 0 PID: 1830 Comm: kworker/u8:6 Not tainted 6.10.0-syzkaller-12708-g2f8c4f506285 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Workqueue: writeback wb_workfn (flush-btrfs-19) RIP: 0010:btrfs_folio_end_all_writers+0x55b/0x610 fs/btrfs/subpage.c:871 Code: e9 d3 fb ff ff e8 65 25 c1 fd 48 c7 c7 80 41 2e 8c 48 c7 c6 40 42 2e 8c 48 c7 c2 20 41 2e 8c b9 67 03 00 00 e8 96 37 d7 07 90 <0f> 0b e8 ee 36 da 07 4c 89 ff be 08 00 00 00 e8 b1 3c 25 fe 4c 89 RSP: 0018:ffffc90004bbecc0 EFLAGS: 00010246 RAX: 0000000000000045 RBX: 00fff0000000402c RCX: f731f933ee271100 RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000 RBP: ffffc90004bbed90 R08: ffffffff8173e03c R09: 1ffff92000977d38 R10: dffffc0000000000 R11: fffff52000977d39 R12: 0000000000000001 R13: dffffc0000000000 R14: 0000000000000000 R15: ffffea0001798900 FS: 0000000000000000(0000) GS:ffff8880b9200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f7fdc4a8440 CR3: 0000000064a54000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __extent_writepage fs/btrfs/extent_io.c:1597 [inline] extent_write_cache_pages fs/btrfs/extent_io.c:2251 [inline] btrfs_writepages+0x14d7/0x2760 fs/btrfs/extent_io.c:2373 do_writepages+0x35d/0x870 mm/page-writeback.c:2683 __writeback_single_inode+0x165/0x10b0 fs/fs-writeback.c:1651 writeback_sb_inodes+0x99c/0x1380 fs/fs-writeback.c:1947 wb_writeback+0x481/0xd40 fs/fs-writeback.c:2127 wb_do_writeback fs/fs-writeback.c:2274 [inline] wb_workfn+0x410/0x1090 fs/fs-writeback.c:2314 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd40 kernel/workqueue.c:3390 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:btrfs_folio_end_all_writers+0x55b/0x610 fs/btrfs/subpage.c:871 Code: e9 d3 fb ff ff e8 65 25 c1 fd 48 c7 c7 80 41 2e 8c 48 c7 c6 40 42 2e 8c 48 c7 c2 20 41 2e 8c b9 67 03 00 00 e8 96 37 d7 07 90 <0f> 0b e8 ee 36 da 07 4c 89 ff be 08 00 00 00 e8 b1 3c 25 fe 4c 89 RSP: 0018:ffffc90004bbecc0 EFLAGS: 00010246 RAX: 0000000000000045 RBX: 00fff0000000402c RCX: f731f933ee271100 RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000 RBP: ffffc90004bbed90 R08: ffffffff8173e03c R09: 1ffff92000977d38 R10: dffffc0000000000 R11: fffff52000977d39 R12: 0000000000000001 R13: dffffc0000000000 R14: 0000000000000000 R15: ffffea0001798900 FS: 0000000000000000(0000) GS:ffff8880b9200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055b29e261000 CR3: 000000001f0f0000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400