WARNING in ext4_destroy_inode

Status: moderation: reported on 2026/12/06 07:57
Subsystems: ext4
Labels: prio:low
[Documentation on labels]
Reported-by: syzbot+6b817707764bef770790@syzkaller.appspotmail.com
First crash: 4h11m, last: 4h11m
✨ AI cause bisection: introduced by (AI job) :
commit 8c4f6e3376348fc3162eed86a05b933921c8f9ed
Author: Zhang Yi <yi.zhang@huawei.com>
Date: Fri Oct 9 10:38:31 2026 +0000

  ext4: introduce a mount option for iomap buffered I/O path

✨ AI-generated root cause summary:

In ext4's iomap buffered I/O path, ext4_block_zero_eof() zeroes the tail of the EOF block before i_size is extended and unlocks the folio before calling ext4_iomap_mark_disksize_pending(). If writeback cleans that EOF block during this gap (without advancing i_disksize because i_size is still unextended) and another block in the same multi-block folio is dirtied (e.g. via concurrent ext4_page_mkwrite(), which does not take inode_lock), ext4_iomap_mark_disksize_pending() checks folio-wide folio_test_dirty(folio) instead of the sub-folio dirty state for the EOF block and erroneously sets EXT4_STATE_DISKSIZE_GROW_PENDING. Subsequent writeback skips the already-clean EOF block in iomap_folio_state and never submits an EXT4_IOMAP_IOEND_DISKSIZE_GROW_IO bio to clear the flag, leaving EXT4_STATE_DISKSIZE_GROW_PENDING set when ext4_destroy_inode() runs during unmount.

▶ ▼ ✨ Full AI root cause analysis
Based on kernel commit 9c9253b2eda8:

Root Cause Analysis

The warning in ext4_destroy_inode() (fs/ext4/super.c:1554-1558) indicates that an inode using the iomap buffered I/O path (EXT4_STATE_BUFFERED_IOMAP) was evicted during unmount (generic_shutdown_super() → sync_filesystem() → evict_inodes() → ext4_evict_inode() → destroy_inode() → ext4_destroy_inode()) with EXT4_STATE_DISKSIZE_GROW_PENDING still set.

Affected Functions, Structs, and Fields

Mechanism and Lifecycle Violation

  1. Pre-extension EOF zeroing and folio unlock window: Callers such as ext4_write_checks() (fs/ext4/file.c:325, prior to ext4_iomap_buffered_write()), ext4_truncate_up() (fs/ext4/inode.c:7035, prior to ext4_set_inode_size()), and ext4_alloc_file_blocks() (fs/ext4/extents.c:4683, prior to ext4_update_inode_size()) invoke ext4_block_zero_eof(inode, from, end) before advancing inode->i_size. Inside it, ext4_block_iomap_zero_range() → iomap_zero_range() zeroes [from, round_up(from, blocksize)) in the EOF block B = from >> i_blkbits, dirties block B in the folio / iomap_folio_state, and unlocks the folio.

  2. Writeback cleans block B without advancing i_disksize: Before ext4_iomap_mark_disksize_pending(inode, from) (fs/ext4/inode.c:4980) re-locks the folio via filemap_lock_folio() and waits via folio_wait_writeback(), writeback can run on the folio. Because inode->i_size has not been extended yet (still equal to old_size), ext4_iomap_wb_update_disksize() (fs/ext4/page-io.c:635) computes new_disksize = min(end, i_size) = old_size, so EXT4_I(inode)->i_disksize is not advanced. As a result, the check at fs/ext4/inode.c:5017:

    if (from >= round_up(READ_ONCE(EXT4_I(inode)->i_disksize), i_blocksize(inode)))
        goto out;
    

    does not bail out even though the zeroed EOF block B has already been written back and cleaned.

  3. Folio-wide dirty check sets EXT4_STATE_DISKSIZE_GROW_PENDING for a clean block: When folio_size(folio) > blocksize (either blocksize < PAGE_SIZE such as 1K/2K ext4 blocks on 4K pages, or large folios enabled via ext4_set_inode_mapping_order() at fs/ext4/inode.c:6286), another block < B in the same folio can be dirtied before ext4_iomap_mark_disksize_pending() acquires the folio lock — for example via concurrent ext4_page_mkwrite() (fs/ext4/inode.c:7994-8003), which acquires mapping->invalidate_lock shared and does not acquire inode->i_rwsem (inode_lock), whereas ext4_buffered_write_iter() holds inode_lock without invalidate_lock.

    At fs/ext4/inode.c:5032-5037, ext4_iomap_mark_disksize_pending() only checks folio-wide folio_test_dirty(folio) rather than checking whether the sub-folio block containing from/i_disksize is dirty in iomap_folio_state. Because another block in the folio is dirty, folio_test_dirty(folio) returns true and EXT4_STATE_DISKSIZE_GROW_PENDING is set even though block B is already clean.

  4. Flag never cleared through writeback or i_nlink != 0 eviction:

    • If the pending operation subsequently fails before dirtying at or beyond B (e.g., -EFAULT during iomap_file_buffered_write()), or only blocks < B are dirty, iomap_writeback_folio() (fs/iomap/buffered-io.c:2052) iterates only dirty sub-folio ranges via iomap_find_dirty_range(). Clean block B is skipped, so ext4_iomap_writeback_submit() (fs/ext4/inode.c:4505-4514) never sees an ioend covering [pstart, pstart + plen) ([i_disksize, round_up(i_disksize, blocksize))) and never tags an ioend with EXT4_IOMAP_IOEND_DISKSIZE_GROW_IO. Consequently, ext4_iomap_end_bio() (fs/ext4/page-io.c:754-755) never clears EXT4_STATE_DISKSIZE_GROW_PENDING.
    • During unmount (generic_shutdown_super() → sync_filesystem() → evict_inodes()), sync_filesystem() writes back and cleans any remaining dirty blocks < B without clearing EXT4_STATE_DISKSIZE_GROW_PENDING. When ext4_evict_inode() runs for a linked inode (inode->i_nlink != 0), it jumps to goto no_delete; at fs/ext4/inode.c:255-265, bypassing the ext4_iomap_clear_disksize_pending(inode) call that only exists in the i_nlink == 0 deletion path at line 275. ext4_destroy_inode() then observes EXT4_STATE_DISKSIZE_GROW_PENDING still set and triggers the WARN_ON_ONCE at fs/ext4/super.c:1554-1555.
▶ ▼ ✨ AI Jobs (2)
ID Workflow Result Correct Bug Created Started Finished Revision
eca24105 bisect-cause IsRelease: ❌ ❓ WARNING in ext4_destroy_inode 2026/12/06 05:26 2026/12/06 05:26 2026/12/06 05:37 3a4d724d
2ee3c2e6 assessment-security DenialOfService: ✅ Exploitable: ❌ FilesystemTrigger: ❌ FuzzingArtifact: ❌ MemoryCorruption: ❌ NetworkNeedsSetup: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ❌ ❓ WARNING in ext4_destroy_inode 2026/12/06 05:24 2026/12/06 05:24 2026/12/06 07:46 3a4d724d

Sample crash report:
------------[ cut here ]------------
WARNING: fs/ext4/super.c:1555 at ext4_destroy_inode+0x310/0x3dc fs/ext4/super.c:1554, CPU#1: syz-executor/4714
Modules linked in:
CPU: 1 UID: 0 PID: 4714 Comm: syz-executor Tainted: G             L      syzkaller #0 PREEMPT 
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
pstate: 83400005 (Nzcv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : ext4_destroy_inode+0x310/0x3dc fs/ext4/super.c:1554
lr : ext4_destroy_inode+0x310/0x3dc fs/ext4/super.c:1554
sp : ffff8000931d7890
x29: ffff8000931d7890 x28: 1ffff0001131f575 x27: 1fffe0001e69543a
x26: 0000000000000000 x25: 1fffe0001b7f5881 x24: 1fffe0001e6953b3
x23: 1fffe0001e695370 x22: ffff0000f34a9b80 x21: dfff800000000000
x20: 0000c02200080000 x19: ffff0000f34a9d70 x18: ffff8001235c3000
x17: ffff0001ace733c3 x16: ffff0000d4b78014 x15: 0000000000000000
x14: 0000000000003315 x13: 0000000000000001 x12: ffff8001235c3000
x11: ffff0001ace67fc0 x10: ffff8000898a4fc0 x9 : 0000000000000000
x8 : 0000000000000000 x7 : ffff800080e4ae04 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff80008118fe48
x2 : 0000800000000000 x1 : ffff0000d4b78000 x0 : 0000000000000000
Call trace:
 ext4_destroy_inode+0x310/0x3dc fs/ext4/super.c:1554 (P)
 destroy_inode+0xb0/0x148 fs/inode.c:387
 evict+0x610/0x7e4 fs/inode.c:853
 dispose_list+0x10c/0x16c fs/inode.c:871
 evict_inodes+0x4d4/0x528 fs/inode.c:924
 generic_shutdown_super+0xb8/0x2c0 fs/super.c:709
 kill_block_super+0x48/0xa4 fs/super.c:1852
 ext4_kill_sb+0x68/0xa8 fs/ext4/super.c:7638
 deactivate_locked_super+0xcc/0x128 fs/super.c:558
 deactivate_super+0xd4/0xf4 fs/super.c:586
 cleanup_mnt+0x190/0x220 fs/namespace.c:1396
 __cleanup_mnt+0x20/0x30 fs/namespace.c:1403
 task_work_run+0x1cc/0x25c kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:70 [inline]
 exit_to_user_mode_loop+0x10c/0x17c kernel/entry/common.c:101
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
 arm64_syscall_exit_to_user_mode arch/arm64/kernel/entry-common.c:147 [inline]
 el0_svc+0x12c/0x1d8 arch/arm64/kernel/entry-common.c:798
 el0t_64_sync_handler+0x44/0x104 arch/arm64/kernel/entry-common.c:816
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:606
irq event stamp: 810370
hardirqs last  enabled at (810369): [<ffff8000805021c8>] rcu_do_enqueue+0x3a4/0x60c kernel/rcu/tree.c:3203
hardirqs last disabled at (810370): [<ffff80008698d5e0>] el1_brk64+0x20/0x54 arch/arm64/kernel/entry-common.c:484
softirqs last  enabled at (810134): [<ffff8000801383b8>] local_bh_enable include/linux/bottom_half.h:33 [inline]
softirqs last  enabled at (810134): [<ffff8000801383b8>] put_cpu_fpsimd_context arch/arm64/kernel/fpsimd.c:251 [inline]
softirqs last  enabled at (810134): [<ffff8000801383b8>] do_sve_acc+0x3ac/0x56c arch/arm64/kernel/fpsimd.c:1332
softirqs last disabled at (810132): [<ffff800080138110>] local_bh_disable include/linux/bottom_half.h:20 [inline]
softirqs last disabled at (810132): [<ffff800080138110>] get_cpu_fpsimd_context arch/arm64/kernel/fpsimd.c:234 [inline]
softirqs last disabled at (810132): [<ffff800080138110>] do_sve_acc+0x104/0x56c arch/arm64/kernel/fpsimd.c:1307
---[ end trace 0000000000000000 ]---
EXT4-fs (loop0): Inode 13 (0000000067578931): EXT4_STATE_DISKSIZE_GROW_PENDING not cleared!
EXT4-fs (loop0): unmounting filesystem 00000000-0000-0000-0000-000000000000.

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/12/06 04:34 https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 9c9253b2eda8 3a4d724d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING in ext4_destroy_inode
* Struck through repros no longer work on HEAD.