From: Brian Foster <bfoster@redhat.com>
To: Mark Tinguely <mark.tinguely@oracle.com>
Cc: linux-xfs@vger.kernel.org, Matt Fleming <matt@readmodwrite.com>
Subject: Re: [External] : [PATCH 1/2] xfs: set minleft correctly for sparse chunk errortag allocation
Date: Fri, 31 Jul 2026 14:40:28 -0400 [thread overview]
Message-ID: <amzsHKUyUyfkFZw_@bfoster> (raw)
In-Reply-To: <920b94f6-9d07-488f-9a11-7e00f7f6612a@oracle.com>
On Fri, Jul 31, 2026 at 01:02:50PM -0500, Mark Tinguely wrote:
> On 7/31/26 11:33 AM, Brian Foster wrote:
> > The errortag instrumentation for forced sparse chunk allocation
> > jumps straight to the allocation path without setting args.minleft.
> > minleft is unconditionally set to ->inobt_maxlevels for the normal
> > allocation path. Lift the assignment to the initial args setup so
> > it covers all possible paths.
> >
> > Assisted-by: LLM
> > Fixes: 1cdadee11f8d ("xfs: randomly do sparse inode allocations in DEBUG mode")
> > Signed-off-by: Brian Foster <bfoster@redhat.com>
> > ---
> > fs/xfs/libxfs/xfs_ialloc.c | 10 ++++------
> > 1 file changed, 4 insertions(+), 6 deletions(-)
> >
> > diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
> > index ffcdd1f691fd..633b2d6e42c5 100644
> > --- a/fs/xfs/libxfs/xfs_ialloc.c
> > +++ b/fs/xfs/libxfs/xfs_ialloc.c
> > @@ -733,6 +733,10 @@ xfs_ialloc_ag_alloc(
> > igeo->maxicount)
> > return -ENOSPC;
> > args.minlen = args.maxlen = igeo->ialloc_blks;
> > +
> > + /* Allow space for the inode btree to split. */
> > + args.minleft = igeo->inobt_maxlevels;
> > +
> > /*
> > * First try to allocate inodes contiguous with the last-allocated
> > * chunk of inodes. If the filesystem is striped, this will fill
> > @@ -764,8 +768,6 @@ xfs_ialloc_ag_alloc(
> > args.alignment = 1;
> > args.minalignslop = igeo->cluster_align - 1;
> > - /* Allow space for the inode btree to split. */
> > - args.minleft = igeo->inobt_maxlevels;
> > error = xfs_alloc_vextent_exact_bno(&args,
> > xfs_agbno_to_fsb(pag, args.agbno));
> > if (error)
> > @@ -804,10 +806,6 @@ xfs_ialloc_ag_alloc(
> > * Allocate a fixed-size extent of inodes.
> > */
> > args.prod = 1;
> > - /*
> > - * Allow space for the inode btree to split.
> > - */
> > - args.minleft = igeo->inobt_maxlevels;
> > error = xfs_alloc_vextent_near_bno(&args,
> > xfs_agbno_to_fsb(pag,
> > be32_to_cpu(agi->agi_root)));
>
>
> Reviewed-by: Mark Tinguely <mark.tinguely@oracle.com>
>
Thanks..
> I got the patches backwards...I agree we need to increase the minleft in
> the other patch by 4 blocks (2 btrees * 2 for the level increase) but I
> wonder why can't a full size inode chunk also split the by-count and
> by-block btrees and the inode btree allocation also be short when fixing AGFL?
>
Yeah, I had the same general question in the original report. I'm not
sure it can't happen for full size chunks. I was kind of taking it for
granted that sparse inodes seem required to reproduce this just by
virtue of smaller allocations and the allocator maybe having enough slop
in the various calculations to gate it otherwise, but I'm not confident
in that having now looked more through this code.
Perhaps Matt can comment on if or how hard we tried to reproduce this
with full inode chunks..? I'm curious.. was the creation of the
reproducer based on a detected flaw in the code (LLM scan or
something?), or a low space stress test or something were this problem
just happened to fall out..?
If we could reproduce or manufacture this with normal inode chunks, then
I suppose that would lend more credence to a more generic solution
within the allocator.
Brian
next prev parent reply other threads:[~2026-07-31 18:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 16:33 [PATCH 0/2] xfs: fix a couple sparse chunk alloc problems Brian Foster
2026-07-31 16:33 ` [PATCH 1/2] xfs: set minleft correctly for sparse chunk errortag allocation Brian Foster
2026-07-31 18:02 ` [External] : " Mark Tinguely
2026-07-31 18:40 ` Brian Foster [this message]
2026-07-31 16:33 ` [PATCH 2/2] xfs: consistent low ag space behavior for sparse inode chunk allocs Brian Foster
2026-07-31 17:54 ` [External] : " Mark Tinguely
2026-08-01 0:11 ` Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=amzsHKUyUyfkFZw_@bfoster \
--to=bfoster@redhat.com \
--cc=linux-xfs@vger.kernel.org \
--cc=mark.tinguely@oracle.com \
--cc=matt@readmodwrite.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.