From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.199 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796194620; b=d1tUvFxpQdUu2nfEhUyafCwV82wy4ijjPaHApIQ1lDZxcfGr5tT8LLbwyjc92CZI49X2 OKXt2OvvE9DqbNFMSgSsKpvxGEokwccyXwXqAcd1cUwVZGn2tZchrJ5NPPB6ifsOi9sej ySLvLGbWWJP+irHA+0Z34dmMnCho/GIzXYt1s35r5C/jibZhFRqY3DqBuSr/07BZ9ElRh wq4Hl+19vNlrhxzKX26bqfuIvcEZpjI225YfBRraLKITK4Y7hiZRfwXcI5lmqRHPEibZQ 0mxhShjt+CKOeLsxYqKIq3fhpuBDGpd7RPc9D1HhCTW6vFvJoQG0kIvQLod4M0M32Bw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796194620; h=DMARC-Filter:Received:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:MIME-Version:X-Received:Date: X-Google-Appengine-App-Id:X-Google-Appengine-App-Id-Alias:Message-ID: Subject:From:To:Content-Type; bh=dJLc1SKde+89nBBSAWrlxwpM+SYyIMvh0KuxdRSHl40=; b=KP0Cr0U5A3yfDQsxucoG0oiibIDJnCDp7ei91ZOByLi0FkeuZXQpdw2tYvmUCgtVAaSG RFjwVrXW4ziRZV/XKLTDWEawngW67liL3BcUIAPFxvwvVxC+swGwDFh07+bzLjY88KKjG w5Y9NXOxgDa12VrXnLjm+KhipIe5MQ1UdGwlq4yzYH30Si/rR3zXjU1YtjnF3bYxIelp1 6032YofvBsoyLv2eiCFRSjRkoErU7SiJ5uPo6JDE1d1QcqrZo+d02DAnBPQ2wCdhUx34U VBQPRp7UZ8dK9BmatGe8KWwSUaXLsUEEssUaG5YZiUTGtLdhezrxJPrZHqgInm40cuw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.remote-ip=209.85.167.199 Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43BE7606A31A for ; Wed, 2 Dec 2026 06:57:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 43BE7606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oi1-f199.google.com with SMTP id 5614622812f47-57eec0f63e8so1074164b6e.2 for ; Tue, 01 Dec 2026 22:57:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796194619; x=1796799419; h=content-type:to:from:subject:message-id:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=dJLc1SKde+89nBBSAWrlxwpM+SYyIMvh0KuxdRSHl40=; b=dtUO/OK8YtPUrg7pDenB/uMe16vXZ2EYYyhCSCdJmn8bgp36I4+slDi7Rh004RJCnV c/LM3J4SWB8fCHGIzT9vcgyvJhyYYed9szNVLotFh792zGnzMlT4TTLIKEOGyCGFHmDP GQCZ7qQF2ZOtd42xeBPKtYKDdwsrzbpLduprixja/VJ0Qm30kV2+9SI518q4fGGZkPX/ DBlO0byOlWdEqftnXr2wGSELAWjuqIv1eRwSk13ZI3hI7UewEzqVFHkIjbX8QhBnueYY yg2VfCwADV4GaKBhzKEsfc8UQ62eHCyQr4VVZ8GNGZ273c7L8DAc0v5NOGkDIVugW61N XrFg== X-Forwarded-Encrypted: i=1; AL+hErH8l9X6vJq4x/iB/NPDmEk6dUlo6OVVy/SJIiRTuosacfNXdta2a09SDQFTUbIZdhg5O3013l5KNCpkdQ==@vger.kernel.org X-Gm-Message-State: APuU4Z9rj8wkQJjbt3tq2KHSVMZf2qdqUr010BOiVwUpXvJ3DlbRP0ip 5PxRdm4jgeMrK0GiMovQB19JKcClJAWdw70EglJWrDRlq4Iyp5KNMPiuwVi6ZJ4fhztdeMZ3mpB pqLbA+2O/erJ8T1W+Gd85/P8GapXQkiVb4QycXz2z19iihY+4uBJCY3Jp/KY= X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-Received: by 2002:a05:6809:14f:10b0:57e:bf29:e30c with SMTP id 5614622812f47-57ebf29e55fmr7394551b6e.67.1796194619370; Tue, 01 Dec 2026 22:56:59 -0800 (PST) Date: Tue, 01 Dec 2026 22:56:59 -0800 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6b0fc13b.3ba11d86.1c9c77.002c.GAE@google.com> Subject: [syzbot] [btrfs?] WARNING in btrfs_destroy_inode (4) From: syzbot To: dsterba@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, mason@kernel.org, syzkaller-bugs@googlegroups.com, wqu@suse.com Content-Type: text/plain; charset="UTF-8" Hello, syzbot found the following issue on: HEAD commit: 19cc08c1a6a6 Merge tag 'clk-fixes-for-linus-v7.4' of git:/.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=1091b3bd580000 kernel config: https://syzkaller.appspot.com/x/.config?x=8979a1c07b42ca5b dashboard link: https://syzkaller.appspot.com/bug?extid=4bfcefc87d9600b7e26a compiler: Debian clang version 22.1.8 (1~deb13u5), Debian LLD 22.1.8 Unfortunately, I don't have any reproducer for this issue yet. Downloadable assets: disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/98fce4d0b21b/non_bootable_disk-19cc08c1.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/d6a560403335/vmlinux-19cc08c1.xz kernel image: https://storage.googleapis.com/syzbot-assets/8f99ab05faae/bzImage-19cc08c1.xz The issue was bisected by AI to: commit 13141df705b7145e46b88b1147d67d7a43f2d9e8 Author: Qu Wenruo Date: Mon Jul 28 08:27:56 2025 +0000 btrfs: make nocow_one_range() to do cleanup on error reasoning: https://syzkaller.appspot.com/ai_job?id=0973296c-18fa-4f4a-9ead-93d0de40947e AI-generated root cause summary: In fs/btrfs/inode.c:nocow_one_range(), when writeback encounters an error (such as btrfs_reloc_clone_csums() returning -EIO), the error path calls btrfs_cleanup_ordered_extents() followed by extent_clear_unlock_delalloc(). Because btrfs_cleanup_ordered_extents() asynchronously queues ordered extent completion to the endio worker pool and btrfs_finish_one_ordered() bypasses extent range locking on BTRFS_ORDERED_IOERR, btrfs_remove_ordered_extent() can execute before extent_clear_unlock_delalloc() clears the EXTENT_DELALLOC bit. When this race occurs, btrfs_remove_ordered_extent() sees outstanding_extents >= 1, recalculates a non-zero reservation size, and releases only excess bytes; subsequently, extent_clear_unlock_delalloc() clears EXTENT_DELALLOC without passing EXTENT_CLEAR_META_RESV, decrementing outstanding_extents without releasing the retained metadata reservation. When the inode is evicted and destroyed, btrfs_destroy_inode() hits WARN_ON(inode->block_rsv.reserved) due to the leaked reservation bytes. full analysis: https://syzkaller.appspot.com/x/ai_root_cause?x=4bfcefc87d9600b7e26a IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+4bfcefc87d9600b7e26a@syzkaller.appspotmail.com The bisection result may be wrong. If you agree with it, please also add: Fixes: 13141df705b7 ("btrfs: make nocow_one_range() to do cleanup on error") loop0: detected capacity change from 0 to 32768 BTRFS: device fsid 14d642db-7b15-43e4-81e6-4b8fac6a25f8 devid 1 transid 8 /dev/loop0 (7:0) scanned by syz.0.0 (5337) BTRFS info (device loop0): first mount of filesystem 14d642db-7b15-43e4-81e6-4b8fac6a25f8 BTRFS info (device loop0): using blake2b checksum algorithm BTRFS info (device loop0): enabling ssd optimizations BTRFS info (device loop0): turning on async discard BTRFS info (device loop0): enabling free space tree BTRFS info (device loop0): use zstd compression, level 3 BTRFS info (device loop0): disk added /dev/nullb0 BTRFS info (device loop0): balance: start -dconvert=raid0 -mconvert=raid0 BTRFS info (device loop0): relocating block group 6881280 flags data|metadata BTRFS info (device loop0): relocating block group 5242880 flags data|metadata BTRFS error (device loop0 state A): Transaction 15 aborted (-EIO) BTRFS: error (device loop0 state A) in __btrfs_update_delayed_inode:1027: errno=-5 IO failure BTRFS info (device loop0 state EA): forced readonly BTRFS: error (device loop0 state EA) in __btrfs_run_delayed_items:1160: errno=-5 IO failure BTRFS warning (device loop0 state EA): Skipping commit of aborted transaction. BTRFS: error (device loop0 state EA) in cleanup_transaction:2089: errno=-5 IO failure BTRFS error (device loop0 state EA): nocow_one_range failed, root=-9 inode=258 start=53248 len=12288: -EIO BTRFS error (device loop0 state EA): run_delalloc_nocow failed, root=18446744073709551607 inode=258 start=53248 len=12288 cur_offset=53248 oe_cleanup=53248 oe_cleanup_len=0 untouched_start=65536 untouched_len=0: -EIO BTRFS error (device loop0 state EA): failed to run delalloc range, root=-9 ino=258 folio=53248 submit_bitmap=0 start=53248 len=12288: -EIO ------------[ cut here ]------------ inode->block_rsv.reserved WARNING: fs/btrfs/inode.c:8096 at btrfs_destroy_inode+0x7a6/0x8c0 fs/btrfs/inode.c:8096, CPU#0: syz.0.0/5337 Modules linked in: CPU: 0 UID: 0 PID: 5337 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:btrfs_destroy_inode+0x7a6/0x8c0 fs/btrfs/inode.c:8096 Code: 46 fd ff e9 da fe ff ff e8 47 15 9b fd 90 0f 0b 90 e9 e7 f8 ff ff e8 39 15 9b fd 90 0f 0b 90 e9 11 f9 ff ff e8 2b 15 9b fd 90 <0f> 0b 90 e9 42 f9 ff ff e8 1d 15 9b fd 90 0f 0b 90 e9 66 f9 ff ff RSP: 0018:ffffc9000e4af8c8 EFLAGS: 00010287 RAX: ffffffff842e4b85 RBX: 0000000000028000 RCX: 0000000000100000 RDX: ffffc9000ef02000 RSI: 000000000008704f RDI: 0000000000087050 RBP: ffff8880143231e0 R08: ffff88804236c7c7 R09: 1ffff1100846d8f8 R10: dffffc0000000000 R11: ffffffff842e43e0 R12: ffff888014323448 R13: 1ffff1100286463c R14: ffff888014323570 R15: dffffc0000000000 FS: 00007fce767d26c0(0000) GS:ffff88808a9e5000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000555ab4af6168 CR3: 0000000014b66000 CR4: 0000000000352ef0 Call Trace: destroy_inode fs/inode.c:387 [inline] evict+0x99e/0xc20 fs/inode.c:853 btrfs_relocate_block_group+0x7b2/0xaf0 fs/btrfs/relocation.c:5562 btrfs_relocate_chunk+0x114/0x810 fs/btrfs/volumes.c:3768 __btrfs_balance+0x1b5f/0x29d0 fs/btrfs/volumes.c:4707 btrfs_balance+0xaa6/0x1180 fs/btrfs/volumes.c:5094 btrfs_ioctl_balance+0x3da/0x640 fs/btrfs/ioctl.c:3518 vfs_ioctl fs/ioctl.c:52 [inline] __do_sys_ioctl fs/ioctl.c:598 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fce759a9b59 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fce767d1fe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fce75c35fa0 RCX: 00007fce759a9b59 RDX: 0000200000011440 RSI: 00000000c4009420 RDI: 0000000000000005 RBP: 00007fce75a3a18b R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fce75c36038 R14: 00007fce75c35fa0 R15: 00007ffef2235c48 --- This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at syzkaller@googlegroups.com. syzbot will keep track of this issue. See: https://goo.gl/tpsmEJ#status for how to communicate with syzbot. For information about bisection process see: https://goo.gl/tpsmEJ#ai-bisection If the report is already addressed, let syzbot know by replying with: #syz fix: exact-commit-title If you want to overwrite report's subsystems, reply with: #syz set subsystems: new-subsystem (See the list of subsystem names on the web dashboard) If the report is a duplicate of another one, reply with: #syz dup: exact-subject-of-another-report If you want to undo deduplication, reply with: #syz undup