EXT4-fs error (device loop0) in ext4_reserve_inode_write:6063: Out of memory ------------[ cut here ]------------ kernel BUG at fs/ext4/ext4.h:2980! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 742 Comm: syz-executor.0 Not tainted 5.4.225-syzkaller-00029-g6a5ec6cea0cd #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 RIP: 0010:ext4_get_group_info fs/ext4/ext4.h:2980 [inline] RIP: 0010:ext4_mb_load_buddy_gfp+0xea8/0xec0 fs/ext4/mballoc.c:1116 Code: ff e8 bc 16 cd ff e9 6f f3 ff ff 89 f9 80 e1 07 80 c1 03 38 c1 0f 8c bc f3 ff ff e8 c2 16 cd ff e9 b2 f3 ff ff e8 98 a4 9e ff <0f> 0b e8 91 a4 9e ff 0f 0b e8 8a a4 9e ff 0f 0b e8 83 a4 9e ff 0f RSP: 0018:ffff8881ef5570e8 EFLAGS: 00010293 RAX: ffffffff81c6da78 RBX: 0000000000000001 RCX: ffff8881e0968fc0 RDX: 0000000000000000 RSI: 00000000ffffe324 RDI: 0000000000000001 RBP: ffff8881e410a000 R08: ffffffff81c6cca2 R09: ffffed103b04f831 R10: ffffed103b04f831 R11: 1ffff1103b04f830 R12: ffff8881e39153f0 R13: 00000000ffffe324 R14: dffffc0000000000 R15: 1ffff1103c722a7e FS: 00007fdd2baa6700(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000002002d0bf CR3: 00000001e465e000 CR4: 00000000003406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ext4_discard_preallocations+0x633/0xba0 fs/ext4/mballoc.c:4101 ext4_truncate+0xa4a/0x12e0 fs/ext4/inode.c:4644 ext4_truncate_failed_write fs/ext4/truncate.h:20 [inline] ext4_write_begin+0xfb6/0x1e70 fs/ext4/inode.c:1396 ext4_da_write_begin+0x4a8/0xf80 fs/ext4/inode.c:3117 generic_perform_write+0x2f9/0x5a0 mm/filemap.c:3311 __generic_file_write_iter+0x239/0x490 mm/filemap.c:3440 ext4_file_write_iter+0x495/0x10e0 fs/ext4/file.c:270 call_write_iter include/linux/fs.h:1981 [inline] new_sync_write fs/read_write.c:483 [inline] __vfs_write+0x5e3/0x780 fs/read_write.c:496 vfs_write+0x210/0x4f0 fs/read_write.c:558 ksys_write+0x198/0x2c0 fs/read_write.c:611 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Modules linked in: ---[ end trace 5f5ca68dda4d657f ]--- RIP: 0010:ext4_get_group_info fs/ext4/ext4.h:2980 [inline] RIP: 0010:ext4_mb_load_buddy_gfp+0xea8/0xec0 fs/ext4/mballoc.c:1116 Code: ff e8 bc 16 cd ff e9 6f f3 ff ff 89 f9 80 e1 07 80 c1 03 38 c1 0f 8c bc f3 ff ff e8 c2 16 cd ff e9 b2 f3 ff ff e8 98 a4 9e ff <0f> 0b e8 91 a4 9e ff 0f 0b e8 8a a4 9e ff 0f 0b e8 83 a4 9e ff 0f RSP: 0018:ffff8881ef5570e8 EFLAGS: 00010293 RAX: ffffffff81c6da78 RBX: 0000000000000001 RCX: ffff8881e0968fc0 RDX: 0000000000000000 RSI: 00000000ffffe324 RDI: 0000000000000001 RBP: ffff8881e410a000 R08: ffffffff81c6cca2 R09: ffffed103b04f831 R10: ffffed103b04f831 R11: 1ffff1103b04f830 R12: ffff8881e39153f0 R13: 00000000ffffe324 R14: dffffc0000000000 R15: 1ffff1103c722a7e FS: 00007fdd2baa6700(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000002002d0bf CR3: 00000001e465e000 CR4: 00000000003406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400