------------[ cut here ]------------ ida_free called for id=48 which is not allocated. WARNING: CPU: 0 PID: 5168 at lib/idr.c:525 ida_free+0x370/0x420 lib/idr.c:525 Modules linked in: CPU: 0 PID: 5168 Comm: syz-executor.2 Not tainted 6.8.0-rc5-syzkaller-00121-g1c892cdd8fe0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 RIP: 0010:ida_free+0x370/0x420 lib/idr.c:525 Code: 10 42 80 3c 28 00 74 05 e8 ed e7 a0 f6 48 8b 7c 24 40 4c 89 fe e8 d0 84 17 00 90 48 c7 c7 80 f9 c4 8c 89 de e8 31 21 06 f6 90 <0f> 0b 90 90 eb 3d e8 45 16 42 f6 49 bd 00 00 00 00 00 fc ff df 4d RSP: 0018:ffffc90004a67300 EFLAGS: 00010246 RAX: 04994cba0bc7d800 RBX: 0000000000000030 RCX: ffff88802c4f5940 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000 RBP: ffffc90004a673f0 R08: ffffffff815779c2 R09: 1ffff9200094cdb4 R10: dffffc0000000000 R11: fffff5200094cdb5 R12: 0000000000000246 R13: dffffc0000000000 R14: ffffffff8e255380 R15: 0000000000000246 FS: 00007efd84e646c0(0000) GS:ffff8880b9400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f1dfa347440 CR3: 000000002f046000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: btrfs_get_root_ref+0xa48/0xaf0 fs/btrfs/disk-io.c:1346 create_pending_snapshot+0xff2/0x2bc0 fs/btrfs/transaction.c:1837 create_pending_snapshots+0x195/0x1d0 fs/btrfs/transaction.c:1931 btrfs_commit_transaction+0xf1c/0x3740 fs/btrfs/transaction.c:2404 create_snapshot+0x507/0x880 fs/btrfs/ioctl.c:848 btrfs_mksubvol+0x5d0/0x750 fs/btrfs/ioctl.c:998 btrfs_mksnapshot+0xb5/0xf0 fs/btrfs/ioctl.c:1044 __btrfs_ioctl_snap_create+0x387/0x4b0 fs/btrfs/ioctl.c:1306 btrfs_ioctl_snap_create_v2+0x1ca/0x400 fs/btrfs/ioctl.c:1393 btrfs_ioctl+0xa74/0xd40 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:857 do_syscall_64+0xf9/0x240 entry_SYSCALL_64_after_hwframe+0x6f/0x77 RIP: 0033:0x7efd8407dda9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007efd84e640c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007efd841abf80 RCX: 00007efd8407dda9 RDX: 00000000200005c0 RSI: 0000000050009417 RDI: 0000000000000003 RBP: 00007efd840ca47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007efd841abf80 R15: 00007ffffbede778