Hi,

A reproducer that triggers this within seconds instead of minutes or hours,
in case it helps test the fix. As root, on an ext4 filesystem:

  d=$(mktemp -d /var/tmp/repro.XXXXXX)
  for i in $(seq 100); do head -c 262144 /dev/urandom > "$d/f$i"; done; sync
  echo 3 > /proc/sys/vm/drop_caches
  rm -rf "$d"; sync

Dropping the caches evicts the mballoc buddy/bitmap pages, and the next free
in that block group oopses (the NULL folio from __filemap_get_folio() in
ext4_mb_load_buddy_gfp()). WARNING: on an affected kernel this hangs every
writer on that filesystem; only a power cycle recovers. On 6.1.190-1 it
completes in a second or two.

It also affects i686 (linux-image-6.1.0-55-686-pae, 6.1.192-1, on a 233 MB
machine, where it happened 6 minutes after boot without any help):

  BUG: kernel NULL pointer dereference, address: 00000000
  Oops: 0000 [#1] PREEMPT SMP PTI
  CPU: 0 PID: 18481 Comm: rm Not tainted 6.1.0-55-686-pae #1  Debian 6.1.192-1
  EIP: ext4_mb_load_buddy_gfp+0xa2/0x360 [ext4]
  Call Trace:
   ext4_free_blocks+0x3cc/0xb80 [ext4]
   ext4_ext_remove_space+0x7da/0x1490 [ext4]
   ext4_ext_truncate+0xd2/0xe0 [ext4]
   ext4_truncate+0x31d/0x500 [ext4]
   ext4_evict_inode+0x2d7/0x700 [ext4]

The test build is amd64 only, so I can't test the fix on i686 yet; I'll run
the reproducer against the fixed 686-pae kernel once it's released.

Thanks for the quick fix.

Sincerely,

Drew Cohan

Reply via email to