From: Brian Foster <bfoster@redhat.com>
To: Mark Tinguely <mark.tinguely@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [External] : [PATCH] xfs: set max_agbno to allow sparse alloc of last full inode chunk
Date: Thu, 8 Jan 2026 14:40:46 -0500 [thread overview]
Message-ID: <aWAIPub1XzMHXOY7@bfoster> (raw)
In-Reply-To: <32881f8f-3b68-49c3-95b0-b1889c08d281@oracle.com>
Adding linux-xfs back to cc.
On Thu, Jan 08, 2026 at 12:37:46PM -0600, Mark Tinguely wrote:
> On 1/8/26 8:11 AM, Brian Foster wrote:
> > Sparse inode cluster allocation sets min/max agbno values to avoid
> > allocating an inode cluster that might map to an invalid inode
> > chunk. For example, we can't have an inode record mapped to agbno 0
> > or that extends past the end of a runt AG of misaligned size.
> >
> > The initial calculation of max_agbno is unnecessarily conservative,
> > however. This has triggered a corner case allocation failure where a
> > small runt AG (i.e. 2063 blocks) is mostly full save for an extent
> > to the EOFS boundary: [2050,13]. max_agbno is set to 2048 in this
> > case, which happens to be the offset of the last possible valid
> > inode chunk in the AG. In practice, we should be able to allocate
> > the 4-block cluster at agbno 2052 to map to the parent inode record
> > at agbno 2048, but the max_agbno value precludes it.
> >
>
> With the same logic, wouldn't the 4 block cluster at agbno 2056 also
> be a valid sparse inode cluster?
>
Nope.. the problem there is that 4 block cluster would map to an inode
record at the same agbno 2056, but that record in the inobt would be
invalid because there are only 7 blocks before the end of the 2063 block
runt AG (full inode records are 8 blocks in this example). So IIRC the
metadata verifiers will complain about this and consider it corruption
and whatnot.
That was actually the issue fixed by Dave's more recent commit
13325333582d ("xfs: fix sparse inode limits on runt AG") in this same
area. The subtlety here is that the calculation was off in this regard
from the start, but it never mattered as such because it wasn't
effective in this small runt AG case in the first place. So that fix
made the min/max agbno bounding logic effective, and with that in place
this fell out more recently pointing out that the original calculation
was a bit too conservative.
Brian
> thanks,
>
> Mark.
>
prev parent reply other threads:[~2026-01-08 19:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-08 14:11 [PATCH] xfs: set max_agbno to allow sparse alloc of last full inode chunk Brian Foster
2026-01-08 17:10 ` Darrick J. Wong
2026-01-08 19:39 ` Brian Foster
2026-01-09 16:07 ` Darrick J. Wong
2026-01-09 17:39 ` Brian Foster
[not found] ` <32881f8f-3b68-49c3-95b0-b1889c08d281@oracle.com>
2026-01-08 19:40 ` Brian Foster [this message]
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=aWAIPub1XzMHXOY7@bfoster \
--to=bfoster@redhat.com \
--cc=linux-xfs@vger.kernel.org \
--cc=mark.tinguely@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox