Re: [PATCH] xfs: avoid inodegc worker flush deadlock

From: ZhengYuan Huang

Date: Sun Mar 29 2026 - 22:40:58 EST


On Mon, Mar 30, 2026 at 9:41 AM Dave Chinner <dgc@xxxxxxxxxx> wrote:
> How did the filesystem get to ENOSPC when freeing an inode?
> That should not happen, so can you please describe what the system
> was doing to trip over this issue?
>
> i.e. the problem that needs to be understood and fixed here is
> "freeing an inode should never see ENOSPC", not "inodegc should not
> recurse"...

Thanks for the reply.

This issue was found by our fuzzing tool, and we are still working on
a reliable reproducer.

>From the logs we have so far, it appears that the filesystem may
already be falling back to m_finobt_nores during mount, before the
later inodegc/ifree path is reached. In particular, we observe
repeated per-AG reservation failures during mount, followed by:

ENOSPC reserving per-AG metadata pool, log recovery may fail.

Based on the current code, my understanding is that when
xfs_fs_reserve_ag_blocks fails, XFS can continue mounting in the
degraded m_finobt_nores mode. In this state, xfs_inactive_ifree may
later take the explicit reservation path, which seems like a plausible
way for ifree to encounter ENOSPC.