Re: [BUG] xfs: undersized log triggers assertion in xfs_log_mount()

From: Carlos Maiolino

Date: Tue Oct 27 2026 - 13:34:13 EST


On Wed, Oct 28, 2026 at 01:00:54AM +0800, 铮 wrote:
> Hi Carlos,
>
> Executing the stored syzkaller testcases on Linux 7.3.0 ultimately triggers
> an assertion in xfs_log_mount():
>
> XFS (loop0): AAIEEE! Log failed size checks. Abort!
> XFS: Assertion failed: 0, file: fs/xfs/xfs_log.c, line: 597
> kernel BUG at fs/xfs/xfs_message.c:102!
> ...
> xfs_log_mount+0x4e3/0x590
> xfs_mountfs+0x10b9/0x2270
> xfs_fs_fill_super+0x15cc/0x20b0
> ...
> Kernel panic - not syncing: Fatal exception
>
> The log size check reports 516 blocks, below the required minimum of
> 636 blocks.
>
> Is this an expected assertion with my XFS debug configuration, or should
> this malformed image be rejected without triggering a kernel BUG?

You have bug_on_assert set on your system, so yes, this is intended. If
you don't want to panic() the machine there, you need to disable it on
sysfs, but...

> Questions
> ---------
> - Is triggering a fatal assertion for an undersized V5 log intentional
> with CONFIG_XFS_DEBUG=y and CONFIG_XFS_ASSERT_FATAL=y, or should this
> case return -EINVAL without triggering a BUG?

The config you have enable explicitly says asserts are fatal. I'm not
sure if I misunderstood you or you misunderstood the configuration
option.


> - If a diagnostic dump would help, what state should be printed before the
> assertion so the malformed image/log geometry can be identified?

You are running a kernel configured with debug configuration that are
meant to crash the system when some issue is found. Those are
configuration settings used for development and debug purposes, not to
use on a production or semi-production system.

Cheers,
Carlos