syz.0.0: attempt to access beyond end of device
loop0: rw=34817, sector=26648, nr_sectors = 8 limit=0
BTRFS error (device loop0): bdev /dev/loop0 errs: wr 3, rd 0, flush 0, corrupt 0, gen 0
BTRFS warning (device loop0): direct IO failed ino 260 op 0x8801 offset 0x7000 len 4096 err no 10
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 1
CPU: 0 UID: 0 PID: 5315 Comm: syz.0.0 Not tainted 6.13.0-rc2-syzkaller-00018-g7cb1b4663150 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
fail_dump lib/fault-inject.c:53 [inline]
should_fail_ex+0x3b0/0x4e0 lib/fault-inject.c:154
should_failslab+0xac/0x100 mm/failslab.c:46
slab_pre_alloc_hook mm/slub.c:4057 [inline]
slab_alloc_node mm/slub.c:4133 [inline]
kmem_cache_alloc_noprof+0x70/0x380 mm/slub.c:4160
add_delayed_ref+0x19e/0x1e90 fs/btrfs/delayed-ref.c:987
btrfs_alloc_tree_block+0xdfc/0x1440 fs/btrfs/extent-tree.c:5178
btrfs_force_cow_block+0x526/0x1da0 fs/btrfs/ctree.c:573
btrfs_cow_block+0x35e/0xa40 fs/btrfs/ctree.c:754
btrfs_search_slot+0xc01/0x3180 fs/btrfs/ctree.c:2156
btrfs_update_device+0x1b0/0x580 fs/btrfs/volumes.c:3020
btrfs_chunk_alloc_add_chunk_item+0x2cb/0x1100 fs/btrfs/volumes.c:5752
do_chunk_alloc fs/btrfs/block-group.c:3899 [inline]
btrfs_chunk_alloc+0x7ca/0xf80 fs/btrfs/block-group.c:4187
find_free_extent_update_loop fs/btrfs/extent-tree.c:4166 [inline]
find_free_extent+0x42d1/0x5810 fs/btrfs/extent-tree.c:4579
btrfs_reserve_extent+0x422/0x810 fs/btrfs/extent-tree.c:4672
btrfs_new_extent_direct fs/btrfs/direct-io.c:186 [inline]
btrfs_get_blocks_direct_write+0x706/0xfa0 fs/btrfs/direct-io.c:321
btrfs_dio_iomap_begin+0xbb7/0x1180 fs/btrfs/direct-io.c:525
iomap_iter+0x697/0xf60 fs/iomap/iter.c:90
__iomap_dio_rw+0x1870/0x25b0 fs/iomap/direct-io.c:702
btrfs_dio_write fs/btrfs/direct-io.c:775 [inline]
btrfs_direct_write+0x610/0xa30 fs/btrfs/direct-io.c:880
btrfs_do_write_iter+0x2a0/0x760 fs/btrfs/file.c:1396
do_iter_readv_writev+0x600/0x880
vfs_writev+0x376/0xba0 fs/read_write.c:1050
do_pwritev fs/read_write.c:1146 [inline]
__do_sys_pwritev2 fs/read_write.c:1204 [inline]
__se_sys_pwritev2+0x196/0x2b0 fs/read_write.c:1195
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc8f0b7ff19
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:00007fc8f05fe058 EFLAGS: 00000246 ORIG_RAX: 0000000000000148
RAX: ffffffffffffffda RBX: 00007fc8f0d46080 RCX: 00007fc8f0b7ff19
RDX: 0000000000000001 RSI: 0000000020000240 RDI: 0000000000000006
RBP: 00007fc8f05fe0a0 R08: 0000000000000000 R09: 0000000000000003
R10: 0000000000007000 R11: 0000000000000246 R12: 0000000000000002
R13: 0000000000000000 R14: 00007fc8f0d46080 R15: 00007ffe3d158c98
BTRFS: error (device loop0 state EA) in do_chunk_alloc:3961: errno=-12 Out of memory
------------[ cut here ]------------
WARNING: CPU: 0 PID: 5315 at fs/btrfs/space-info.h:250 btrfs_space_info_update_bytes_may_use+0x34c/0x660 fs/btrfs/space-info.h:250
Modules linked in:
CPU: 0 UID: 0 PID: 5315 Comm: syz.0.0 Not tainted 6.13.0-rc2-syzkaller-00018-g7cb1b4663150 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:btrfs_space_info_update_bytes_may_use+0x34c/0x660 fs/btrfs/space-info.h:250
Code: 00 00 74 08 4c 89 ff e8 92 1b 26 fe 49 8b 1f 48 89 df 48 8b 6c 24 20 48 89 ee e8 6f be bf fd 48 39 eb 73 1d e8 05 bc bf fd 90 <0f> 0b 90 45 31 f6 43 80 7c 25 00 00 0f 85 2e ff ff ff e9 31 ff ff
RSP: 0018:ffffc9000d4eeb38 EFLAGS: 00010293
RAX: ffffffff83dfa23b RBX: 000000000005c000 RCX: ffff888000a3c880
RDX: 0000000000000000 RSI: 0000000000060000 RDI: 000000000005c000
RBP: 0000000000060000 R08: ffffffff83dfa231 R09: 1ffffffff2032cae
R10: dffffc0000000000 R11: fffffbfff2032caf R12: dffffc0000000000
R13: 1ffff110087f670d R14: fffffffffffa0000 R15: ffff888043fb3868
FS: 00007fc8f05fe6c0(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fff0a289f98 CR3: 000000001cf3e000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
btrfs_space_info_free_bytes_may_use fs/btrfs/space-info.h:283 [inline]
block_rsv_release_bytes fs/btrfs/block-rsv.c:153 [inline]
btrfs_block_rsv_release+0x4f4/0x5f0 fs/btrfs/block-rsv.c:294
btrfs_trans_release_chunk_metadata+0x7f/0xb0 fs/btrfs/transaction.c:253
do_chunk_alloc fs/btrfs/block-group.c:3965 [inline]
btrfs_chunk_alloc+0xd68/0xf80 fs/btrfs/block-group.c:4187
find_free_extent_update_loop fs/btrfs/extent-tree.c:4166 [inline]
find_free_extent+0x42d1/0x5810 fs/btrfs/extent-tree.c:4579
btrfs_reserve_extent+0x422/0x810 fs/btrfs/extent-tree.c:4672
btrfs_new_extent_direct fs/btrfs/direct-io.c:186 [inline]
btrfs_get_blocks_direct_write+0x706/0xfa0 fs/btrfs/direct-io.c:321
btrfs_dio_iomap_begin+0xbb7/0x1180 fs/btrfs/direct-io.c:525
iomap_iter+0x697/0xf60 fs/iomap/iter.c:90
__iomap_dio_rw+0x1870/0x25b0 fs/iomap/direct-io.c:702
btrfs_dio_write fs/btrfs/direct-io.c:775 [inline]
btrfs_direct_write+0x610/0xa30 fs/btrfs/direct-io.c:880
btrfs_do_write_iter+0x2a0/0x760 fs/btrfs/file.c:1396
do_iter_readv_writev+0x600/0x880
vfs_writev+0x376/0xba0 fs/read_write.c:1050
do_pwritev fs/read_write.c:1146 [inline]
__do_sys_pwritev2 fs/read_write.c:1204 [inline]
__se_sys_pwritev2+0x196/0x2b0 fs/read_write.c:1195
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc8f0b7ff19
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:00007fc8f05fe058 EFLAGS: 00000246 ORIG_RAX: 0000000000000148
RAX: ffffffffffffffda RBX: 00007fc8f0d46080 RCX: 00007fc8f0b7ff19
RDX: 0000000000000001 RSI: 0000000020000240 RDI: 0000000000000006
RBP: 00007fc8f05fe0a0 R08: 0000000000000000 R09: 0000000000000003
R10: 0000000000007000 R11: 0000000000000246 R12: 0000000000000002
R13: 0000000000000000 R14: 00007fc8f0d46080 R15: 00007ffe3d158c98