mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [BUG] btrfs: WARNING in btrfs_create_pending_block_groups
@ 2026-09-15  7:54 CJ
  0 siblings, 0 replies; only message in thread
From: CJ @ 2026-09-15  7:54 UTC (permalink / raw)
  To: clm, dsterba; +Cc: linux-btrfs, linux-kernel


Hi,


I am reporting a WARNING while btrfs creates pending block groups, triggered by
a syzkaller reproducer that mounts a crafted btrfs image.  The issue is
reproducible with HEAD commit cee9395acd8043be0644b25c34bfa86623f2b935
(v7.3-rc1, Linux 7.3.0-rc1).


The reproducer mounts a crafted btrfs filesystem image on a loop device with the
free space tree enabled, and then starts a balance with usage limits.  The
console shows the mount and the balance start succeeding before the warning.


The console shows a WARNING at fs/btrfs/block-group.c:2944 with RIP in
btrfs_create_pending_block_groups, reached from the transaction commit path while
the balance is turning the block group read-only.  In the original report the
same warning was recorded at fs/btrfs/block-group.c:2441 in the same function, so
only the source line has moved.


One possible cause is that the block group created from the crafted image does
not satisfy the assumption btrfs_create_pending_block_groups makes about the
block group's type or reservation state when it is committed, so the invariant
check fires.  This looks like a validation gap for disk-derived block group
state rather than a transaction problem.  I note that 8bc4d7209611 and
e549093c11a2 touched the block group reservation path but not this check.  I am
reporting the warning and the path as observed.


This appears to be a recurrence of the syzbot issue whose external id is
ecef109a157e70c06e25.  It remains reproducible on v7.3-rc1.


Reproducer:


syz reproducer: https://pastebin.com/raw/u2Q4fnjB

console output:  https://pastebin.com/raw/xtyfw2bm

kernel config: https://pastebin.com/raw/NHavpy6R


Kernel:


HEAD commit: cee9395acd8043be0644b25c34bfa86623f2b935
git tree: upstream (linux.git), tested through the v7.3-rc1 annotated tag object
           e5e04726cdd043e309677071ab1b65a4b18f422b
kernel version: 7.3.0-rc1 #1 PREEMPT(full)
tested tag: v7.3-rc1 (Linux 7.3-rc1, 2026-08-30)


Let me know if you need more details or testing.


Best regards,
Changjian




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-15  7:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-15  7:54 [BUG] btrfs: WARNING in btrfs_create_pending_block_groups CJ

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®