bcachefs (loop4): pointer to nonexistent device 237 ------------[ cut here ]------------ unhandled error case in bch2_bkey_pick_read_device WARNING: CPU: 1 PID: 5986 at fs/bcachefs/extents.c:230 bch2_bkey_pick_read_device+0x17a5/0x1a00 fs/bcachefs/extents.c:230 Modules linked in: CPU: 1 UID: 0 PID: 5986 Comm: syz.4.14 Not tainted 6.14.0-syzkaller-09584-g7d06015d936c #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 RIP: 0010:bch2_bkey_pick_read_device+0x17a5/0x1a00 fs/bcachefs/extents.c:230 Code: 91 be 59 fd e9 d0 fd ff ff e8 87 be 59 fd c6 05 9d 39 dd 0b 01 90 48 c7 c7 e0 9c 93 8c 48 c7 c6 40 52 58 8e e8 bc ce 18 fd 90 <0f> 0b 90 90 e9 bc fe ff ff e8 5d be 59 fd e9 6e ff ff ff 89 d9 80 RSP: 0018:ffffc900047ed4a0 EFLAGS: 00010246 RAX: c5020a022e999800 RBX: 0000000000000000 RCX: 0000000000080000 RDX: ffffc9000d2fe000 RSI: 000000000000643c RDI: 000000000000643d RBP: ffffc900047ed6d0 R08: ffffffff81829c92 R09: fffffbfff1d7a73c R10: dffffc0000000000 R11: fffffbfff1d7a73c R12: dffffc0000000000 R13: 1ffff920008fdabc R14: 0000000000000000 R15: 0000000000000000 FS: 00007fad5421b6c0(0000) GS:ffff888125111000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fe2b4d705a0 CR3: 000000003190c000 CR4: 00000000003526f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __bch2_read_extent+0x3ab/0x4400 fs/bcachefs/io_read.c:962 bch2_read_extent fs/bcachefs/io_read.h:140 [inline] bchfs_read+0x2a88/0x3300 fs/bcachefs/fs-io-buffered.c:226 bch2_readahead+0xe7a/0x12d0 fs/bcachefs/fs-io-buffered.c:301 read_pages+0x193/0x590 mm/readahead.c:160 page_cache_ra_order+0xa37/0xca0 mm/readahead.c:515 filemap_get_pages+0x59f/0x1fc0 mm/filemap.c:2602 filemap_read+0x466/0x1260 mm/filemap.c:2713 bch2_read_iter+0x1179/0x14b0 fs/bcachefs/fs-io-direct.c:221 __kernel_read+0x532/0xa10 fs/read_write.c:528 integrity_kernel_read+0xb2/0x100 security/integrity/iint.c:28 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:480 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:511 [inline] ima_calc_file_hash+0xaa0/0x1af0 security/integrity/ima/ima_crypto.c:568 ima_collect_measurement+0x52b/0xb20 security/integrity/ima/ima_api.c:293 process_measurement+0x13a3/0x1fe0 security/integrity/ima/ima_main.c:383 ima_file_check+0xdb/0x130 security/integrity/ima/ima_main.c:611 security_file_post_open+0xb9/0x280 security/security.c:3130 do_open fs/namei.c:3847 [inline] path_openat+0x2cf7/0x35d0 fs/namei.c:4004 do_filp_open+0x284/0x4e0 fs/namei.c:4031 do_sys_openat2+0x12b/0x1d0 fs/open.c:1429 do_sys_open fs/open.c:1444 [inline] __do_sys_openat fs/open.c:1460 [inline] __se_sys_openat fs/open.c:1455 [inline] __x64_sys_openat+0x249/0x2a0 fs/open.c:1455 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fad5338d169 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:00007fad5421b038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fad535a5fa0 RCX: 00007fad5338d169 RDX: 0000000000002000 RSI: 0000200000005b40 RDI: ffffffffffffff9c RBP: 00007fad5340e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000082 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fad535a5fa0 R15: 00007ffdb24e7db8