Linux XFS filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Carlos Maiolino <cem@kernel.org>
Cc: hch@lst.de, stable@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 07/12] xfs: check for fragments when full-extent sharing matches
Date: Wed, 14 Oct 2026 10:40:27 -0700	[thread overview]
Message-ID: <20261014174027.GJ2705364@frogsfrogsfrogs> (raw)
In-Reply-To: <as84RR9BrH82CPMG@nidhogg.toxiclabs.cc>

On Wed, Oct 14, 2026 at 10:26:04AM +0200, Carlos Maiolino wrote:
> On Mon, Oct 12, 2026 at 11:07:01PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > LOLLM noticed that xchk_refcountbt_process_rmap_fragments returns early
> > if there are enough rmap records that overlap the space referenced by a
> > refcountbt record to match the refcount in that refcountbt record.
> > Unfortunately, it never checks the fragment list in this case, so it
> > won't find the discrepancy between the rmap and refcount btrees.
> > 
> > Cc: <stable@vger.kernel.org> # v4.16
> > Fixes: dbde19da963706 ("xfs: cross-reference the rmapbt data with the refcountbt")
> > Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
> > Assisted-by: LOLLM # finding obvious bugs
> > Reviewed-by: Christoph Hellwig <hch@lst.de>
> 
> Same thing for this patch... Final patch is:
> 
> commit 95e213c1ddb40dfb0a8178ed35c9f29992a320e1
> Author: Darrick J. Wong <djwong@kernel.org>
> Date:   Mon Oct 12 23:07:01 2026 -0700
> 
>     xfs: check for fragments when full-extent sharing matches

Also looks good.

--D

> 
> > ---
> >  fs/xfs/scrub/refcount.c   |    5 ++++-
> >  fs/xfs/scrub/rtrefcount.c |    5 ++++-
> >  2 files changed, 8 insertions(+), 2 deletions(-)
> > 
> > 
> > diff --git a/fs/xfs/scrub/refcount.c b/fs/xfs/scrub/refcount.c
> > index a900d13c9e27c0..883c273cb9883f 100644
> > --- a/fs/xfs/scrub/refcount.c
> > +++ b/fs/xfs/scrub/refcount.c
> > @@ -185,8 +185,11 @@ xchk_refcountbt_process_rmap_fragments(
> >  	xfs_nlink_t			target_nr;
> >  
> >  	target_nr = refchk->refcount - refchk->seen;
> > -	if (target_nr == 0)
> > +	if (target_nr == 0) {
> > +		if (!list_empty(&refchk->fragments))
> > +			refchk->seen = 0;
> >  		return;
> > +	}
> >  
> >  	/*
> >  	 * There are (refchk->rc.rc_refcount - refchk->nr refcount)
> > diff --git a/fs/xfs/scrub/rtrefcount.c b/fs/xfs/scrub/rtrefcount.c
> > index 00da8e98506d63..c312096e410561 100644
> > --- a/fs/xfs/scrub/rtrefcount.c
> > +++ b/fs/xfs/scrub/rtrefcount.c
> > @@ -200,8 +200,11 @@ xchk_rtrefcountbt_process_rmap_fragments(
> >  	xfs_nlink_t			target_nr;
> >  
> >  	target_nr = refchk->refcount - refchk->seen;
> > -	if (target_nr == 0)
> > +	if (target_nr == 0) {
> > +		if (!list_empty(&refchk->fragments))
> > +			refchk->seen = 0;
> >  		return;
> > +	}
> >  
> >  	/*
> >  	 * There are (refchk->rc.rc_refcount - refchk->nr refcount)
> > 
> 

  reply	other threads:[~2026-10-14 17:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13  6:05 [PATCHSET v2 1/2] xfs: LLM-inspired bug fixes, part 22 Darrick J. Wong
2026-10-13  6:05 ` [PATCH 01/12] xfs: don't overrun incore inode when cleaning attr forks Darrick J. Wong
2026-10-13  6:05 ` [PATCH 02/12] xfs: fix data fork block count check in xrep_inode_blockcounts Darrick J. Wong
2026-10-13  6:05 ` [PATCH 03/12] xfs: avoid oversized space allocations when regenerating metadata Darrick J. Wong
2026-10-13  6:06 ` [PATCH 04/12] xfs: reduce new btree slack factor if free space is negative Darrick J. Wong
2026-10-13  7:36   ` Christoph Hellwig
2026-10-13  6:06 ` [PATCH 05/12] xfs: don't queue rmap update twice when reaping a fork Darrick J. Wong
2026-10-13  6:06 ` [PATCH 06/12] xfs: only written file data blocks can be shared Darrick J. Wong
2026-10-13 11:47   ` Christoph Hellwig
2026-10-14  8:25   ` Carlos Maiolino
2026-10-14 17:40     ` Darrick J. Wong
2026-10-13  6:07 ` [PATCH 07/12] xfs: check for fragments when full-extent sharing matches Darrick J. Wong
2026-10-14  8:26   ` Carlos Maiolino
2026-10-14 17:40     ` Darrick J. Wong [this message]
2026-10-13  6:07 ` [PATCH 08/12] xfs: don't clear COWEXTSIZE on directories on reflink filesystems Darrick J. Wong
2026-10-13  6:07 ` [PATCH 09/12] xfs: clear set[ug]id mode bits when zapping attr fork Darrick J. Wong
2026-10-13  6:07 ` [PATCH 10/12] xfs: opportunistically skip btree block checks Darrick J. Wong
2026-10-13  7:36   ` Christoph Hellwig
2026-10-13  6:08 ` [PATCH 11/12] xfs: always report scrub errors in tracepoints Darrick J. Wong
2026-10-13  6:08 ` [PATCH 12/12] xfs: don't scan across metadata/regular directory trees for dirents Darrick J. Wong
2026-10-14  8:28 ` [PATCHSET v2 1/2] xfs: LLM-inspired bug fixes, part 22 Carlos Maiolino
  -- strict thread matches above, loose matches on Subject: below --
2026-10-12  5:55 [PATCHSET " Darrick J. Wong
2026-10-12  5:57 ` [PATCH 07/12] xfs: check for fragments when full-extent sharing matches Darrick J. Wong
2026-10-12 13:09   ` Christoph Hellwig

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=20261014174027.GJ2705364@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=cem@kernel.org \
    --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