From: "Darrick J. Wong" <djwong@kernel.org>
To: Carlos Maiolino <cem@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>,
dgc@kernel.org, floss@jetm.me, stable@vger.kernel.org,
linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/7] xfs: fix under-reservation of blocks when repairing sf directories
Date: Wed, 9 Sep 2026 23:09:07 -0700 [thread overview]
Message-ID: <20260910060907.GC6253@frogsfrogsfrogs> (raw)
In-Reply-To: <aqJANTuQQMEIqcmO@andromeda.toxiclabs.cc>
On Thu, Sep 10, 2026 at 07:31:37AM +0200, Carlos Maiolino wrote:
> On Thu, Sep 10, 2026 at 07:00:31AM +0200, Christoph Hellwig wrote:
> > On Tue, Sep 08, 2026 at 11:04:35PM -0700, Darrick J. Wong wrote:
> > > +static inline unsigned int
> > > +xrep_tempexch_estimate_sf_resblks(
> > > + struct xfs_scrub *sc,
> > > + int whichfork)
> > > +{
> > > + if (whichfork == XFS_ATTR_FORK)
> > > + return sc->mp->m_attr_geo->fsbcount;
> > > + if (S_ISDIR(VFS_I(sc->ip)->i_mode))
> > > + return sc->mp->m_dir_geo->fsbcount;
> > > + return 1;
> >
> > geo->fsbcount for attrs is a always 1 and a lot of code relies on that,
> > so this feels a bit overcomplicated and misleading (but still correct).
> >
> > What about the more usual:
> >
> > if (S_ISDIR(VFS_I(sc->ip)->i_mode) && whichfork == XFS_DATA_FORK)
> > return sc->mp->m_dir_geo->fsbcount;
> > return 1;
I prefer not to leave a logic bomb in the scrub code in case we ever
have multi-fsblock attr blocks.
Though I guess I'd be ok with
ASSERT(mp->m_attr_geo->fsbcount == 1);
if (S_ISDIR(VFS_I(sc->ip)->i_mode) && whichfork == XFS_DATA_FORK)
return sc->mp->m_dir_geo->fsbcount;
return 1;
or something like that?
> Either are fine to me so feel free to add:
>
> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
But only if Carlos really wants me to add that.
--D
>
> >
> > ?
> >
> > Otherwise looks good:
> >
> > Reviewed-by: Christoph Hellwig <hch@lst.de>
> >
next prev parent reply other threads:[~2026-09-10 6:09 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 6:02 [PATCHSET 2/2] xfs: LLM-inspired bug fixes, part 12 Darrick J. Wong
2026-09-09 6:04 ` [PATCH 1/7] xfs: fix under-reservation of blocks when repairing sf directories Darrick J. Wong
2026-09-10 5:00 ` Christoph Hellwig
2026-09-10 5:31 ` Carlos Maiolino
2026-09-10 6:09 ` Darrick J. Wong [this message]
2026-09-10 6:27 ` Carlos Maiolino
2026-09-10 9:43 ` Christoph Hellwig
2026-09-10 15:08 ` Darrick J. Wong
2026-09-11 4:42 ` [PATCH v1.1 " Darrick J. Wong
2026-09-11 7:29 ` Carlos Maiolino
2026-09-11 11:46 ` Christoph Hellwig
2026-09-09 6:04 ` [PATCH 2/7] xfs: actually check internal-rtdev fields in the superblock Darrick J. Wong
2026-09-10 5:42 ` Carlos Maiolino
2026-09-11 7:29 ` Carlos Maiolino
2026-09-09 6:05 ` [PATCH 3/7] xfs: fix rtrmap cross-referencing elision logic Darrick J. Wong
2026-09-10 5:01 ` Christoph Hellwig
2026-09-10 5:46 ` Carlos Maiolino
2026-09-09 6:05 ` [PATCH 4/7] xfs: fix termination logic in xchk_bmap Darrick J. Wong
2026-09-10 5:01 ` Christoph Hellwig
2026-09-10 5:47 ` Carlos Maiolino
2026-09-09 6:05 ` [PATCH 5/7] xfs: fix replaying dirent removals into the temporary directory Darrick J. Wong
2026-09-10 5:01 ` Christoph Hellwig
2026-09-10 5:51 ` Carlos Maiolino
2026-09-09 6:05 ` [PATCH 6/7] xfs: reset parent pointer args before each dir tree unlink repair Darrick J. Wong
2026-09-10 5:02 ` Christoph Hellwig
2026-09-10 5:59 ` Carlos Maiolino
2026-09-09 6:06 ` [PATCH 7/7] xfs: advance the findparent inode scan cursor while holding ILOCK Darrick J. Wong
2026-09-10 5:04 ` Christoph Hellwig
2026-09-10 7:35 ` Carlos Maiolino
2026-09-11 7:28 ` [PATCHSET 2/2] xfs: LLM-inspired bug fixes, part 12 Carlos Maiolino
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=20260910060907.GC6253@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=cem@kernel.org \
--cc=dgc@kernel.org \
--cc=floss@jetm.me \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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