reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x425/0x4c0 mm/page_alloc.c:2347 free_unref_folios+0x125/0x5a0 mm/page_alloc.c:2536 folios_put_refs+0x1dc/0x210 mm/swap.c:1034 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x279/0x920 mm/shmem.c:1005 shmem_truncate_range mm/shmem.c:1114 [inline] shmem_evict_inode+0x13b/0x300 mm/shmem.c:1242 evict+0xca/0x220 fs/inode.c:667 __dentry_kill+0xaa/0x200 fs/dcache.c:603 dput+0x75/0xe0 fs/dcache.c:845 __fput+0x1a4/0x290 fs/file_table.c:430 __do_sys_close fs/open.c:1556 [inline] __se_sys_close+0x6b/0xc0 fs/open.c:1541 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xe2/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f ------------[ cut here ]------------ kernel BUG at mm/filemap.c:1483! invalid opcode: 0000 [#1] PREEMPT SMP PTI CPU: 0 PID: 3242 Comm: syz.0.15 Not tainted 6.9.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 RIP: 0010:folio_unlock+0x73/0xb0 mm/filemap.c:1483 Code: 47 48 a8 01 74 bf 48 ff c8 48 39 f8 74 b7 48 c7 c6 99 15 58 83 e8 ed 4d 05 00 90 0f 0b 48 c7 c6 a6 67 5a 83 e8 de 4d 05 00 90 <0f> 0b f3 0f 1e fa 48 89 f8 48 c1 e0 34 75 9d 48 f7 07 40 00 00 00 RSP: 0018:ffffc90002eb7a18 EFLAGS: 00010246 RAX: 950970d4796d6500 RBX: 00000000ffffffe2 RCX: 950970d4796d6500 RDX: 0000000000000002 RSI: ffffffff8358862e RDI: ffffffff8363b17d RBP: ffff88817d7a0e58 R08: 0000000000000000 R09: ffffffff83accfe0 R10: ffffc90002eb7738 R11: ffffc90002eb76e0 R12: ffff88817d7a0e58 R13: 0000000000000000 R14: 0000000000000001 R15: ffffea0005e6ecc0 FS: 0000555591a3b500(0000) GS:ffff888237c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020000280 CR3: 0000000105b7c000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __extent_writepage fs/btrfs/extent_io.c:1519 [inline] extent_write_cache_pages fs/btrfs/extent_io.c:2173 [inline] btrfs_writepages+0x9e5/0xc20 fs/btrfs/extent_io.c:2294 do_writepages+0xd9/0x300 mm/page-writeback.c:2612 filemap_fdatawrite_wbc+0x60/0x80 mm/filemap.c:397 __filemap_fdatawrite_range mm/filemap.c:430 [inline] __filemap_fdatawrite mm/filemap.c:436 [inline] filemap_flush+0x4f/0x80 mm/filemap.c:463 btrfs_release_file+0x54/0x60 fs/btrfs/file.c:1737 __fput+0xfc/0x290 fs/file_table.c:422 task_work_run+0x82/0xb0 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0xb6/0x1f0 kernel/entry/common.c:218 do_syscall_64+0xef/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f99a4975b59 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc83221428 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 00007f99a4b05a60 RCX: 00007f99a4975b59 RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 00007f99a4b05a60 R08: 0000000000000006 R09: 0000000a8322174f R10: 000000000003fd84 R11: 0000000000000246 R12: 000000000000d305 R13: 0000000000000032 R14: 00007f99a4b05a60 R15: 00007f99a4b04038 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:folio_unlock+0x73/0xb0 mm/filemap.c:1483 Code: 47 48 a8 01 74 bf 48 ff c8 48 39 f8 74 b7 48 c7 c6 99 15 58 83 e8 ed 4d 05 00 90 0f 0b 48 c7 c6 a6 67 5a 83 e8 de 4d 05 00 90 <0f> 0b f3 0f 1e fa 48 89 f8 48 c1 e0 34 75 9d 48 f7 07 40 00 00 00 RSP: 0018:ffffc90002eb7a18 EFLAGS: 00010246 RAX: 950970d4796d6500 RBX: 00000000ffffffe2 RCX: 950970d4796d6500 RDX: 0000000000000002 RSI: ffffffff8358862e RDI: ffffffff8363b17d RBP: ffff88817d7a0e58 R08: 0000000000000000 R09: ffffffff83accfe0 R10: ffffc90002eb7738 R11: ffffc90002eb76e0 R12: ffff88817d7a0e58 R13: 0000000000000000 R14: 0000000000000001 R15: ffffea0005e6ecc0 FS: 0000555591a3b500(0000) GS:ffff888237c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020000280 CR3: 0000000105b7c000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400