All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: cem@kernel.org, stable@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 06/12] xfs: only written file data blocks can be shared
Date: Mon, 12 Oct 2026 06:09:16 -0700	[thread overview]
Message-ID: <aszb_INSp9qbSTf-@infradead.org> (raw)
In-Reply-To: <179178065324.1058326.3356948076285838276.stgit@frogsfrogsfrogs>

On Sun, Oct 11, 2026 at 10:57:18PM -0700, Darrick J. Wong wrote:
> +	/*
> +	 * The refcount btree should only have records for written file data
> +	 * blocks or for COW staging blocks.
> +	 */
> +	if ((XFS_RMAP_NON_INODE_OWNER(rec->rm_owner) &&
> +	     rec->rm_owner != XFS_RMAP_OWN_COW) ||
> +	    (rec->rm_flags & (XFS_RMAP_ATTR_FORK | XFS_RMAP_BMBT_BLOCK |
> +			      XFS_RMAP_UNWRITTEN))) {
> +		xchk_btree_xref_set_corrupt(refchk->sc, cur, 0);
> +		return 0;
> +	}

> +	/*
> +	 * The refcount btree should only have records for written file data
> +	 * blocks or for COW staging blocks.
> +	 */
> +	if ((XFS_RMAP_NON_INODE_OWNER(rec->rm_owner) &&
> +	     rec->rm_owner != XFS_RMAP_OWN_COW) ||
> +	    (rec->rm_flags & (XFS_RMAP_ATTR_FORK | XFS_RMAP_BMBT_BLOCK |
> +			      XFS_RMAP_UNWRITTEN))) {
> +		xchk_btree_xref_set_corrupt(refchk->sc, cur, 0);
> +		return 0;
> +	}

Can we have a shared helper for this conditional?

Otherwise this looks good.


  reply	other threads:[~2026-10-12 13:09 UTC|newest]

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

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=aszb_INSp9qbSTf-@infradead.org \
    --to=hch@infradead.org \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --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 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.