Linux filesystem development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>, Carlos Maiolino <cem@kernel.org>,
	Jens Axboe <axboe@kernel.dk>,
	Christian Brauner <brauner@kernel.org>,
	linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 09/21] xfs: add support for per-RTG csum files
Date: Fri, 25 Sep 2026 08:10:31 +0200	[thread overview]
Message-ID: <20260925061031.GF3193@lst.de> (raw)
In-Reply-To: <20260924222442.GJ2705364@frogsfrogsfrogs>

On Thu, Sep 24, 2026 at 03:24:42PM -0700, Darrick J. Wong wrote:
> > +	if (XFS_IS_CORRUPT(mp, ifp->if_nextents != 1))
> > +		goto sick;
> > +
> > +	/*
> > +	 * We can do an unlocked lookup here because the bmap btree for the
> > +	 * csum files is immutable once created.
> > +	 */
> 
> This might be problematic if we ever want online repair to be able to
> rebuild the checksum file data fork at runtime.  That would probably
> cause catastrophic loss of file data integrity guarantees, but that
> might be better than the filesystem dying.

repair is still on my todo list, but the plan would be to use a static_call
to introduce looking if/when we have to online repair to add locking.

> > +/* Convert an rgbno to the csum byte position in the csum file. */
> > +static inline xfs_off_t
> > +xfs_rgb_to_rtcsumpos(
> 
> rgbno_to_ ?

Yeah.

> 
> > +	struct xfs_mount	*mp,
> > +	xfs_rtblock_t		rgbno)
> 
> Shouldn't ^^^^ this be an xfs_rgblock_t given the name and comment?

Yes.

> I don't think you support checksums on !rtgroups filesystems, so you'll
> never have to deal with a rt block address larger than 2^32.

Yes, this is zoned only and zoned requires rtgroups.  Even if for some
reason we want to support non-zoned, requiring rtgroups is required for
the per-group file infrastucture.

> 
> > +{
> > +	return (xfs_off_t)rgbno << mp->m_rtcsum_shift;
> 
> Hrm.  What's the difference between this and +xfs_extlen_to_rtcsum_len?
> I guess one describes a quantity of fsblocks, whereas another describes
> an address?

Yes, which implies 32 vs 64bit values.
> > +static inline xfs_filblks_t
> > +xfs_rtcsum_max_len(
> > +	struct xfs_mount	*mp,
> > +	xfs_fsblock_t		fsbno)
> > +{
> > +	return xfs_rtcsum_len_to_extlen(mp,
> > +			mp->m_rtcsum_bsize - xfs_rtb_to_rtcsumoff(mp, fsbno));
> > +}
> 
> What does this do?  Does it compute the number of checksums you can
> write to the rest of a single csum file block given a fsblock address?

Yes, although the limiting factor is reads where the code wants to deal
with a single buffer per read.  For writes the data is logged where
we can trivially loop over buffers.

> > +union xfs_csum {
> > +	uint32_t		crc32c;
> > +	uint64_t		crc64;
> > +};
> > +
> > +static __always_inline void
> > +xfs_csum_seed(
> > +	struct xfs_mount	*mp,
> > +	union xfs_csum		*csum)
> > +{
> > +	if (mp->m_sb.sb_rtcsum_type == XFS_CSUM_TYPE_CRC32C)
> > +		csum->crc32c = XFS_CRC_SEED;
> > +	else
> > +		csum->crc64 = XFS_CRC64_SEED;
> 
> I was expecting a switch() here. ;)

That would require coming up with something for the impossible case,
so I'd rather side-step it.


  reply	other threads:[~2026-09-25  6:10 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24  9:59 support for RT data checksums Christoph Hellwig
2026-09-24  9:59 ` [PATCH 01/21] block: export fs_bio_integrity_verify Christoph Hellwig
2026-09-24 20:29   ` Darrick J. Wong
2026-09-24  9:59 ` [PATCH 02/21] iomap: add support for data checksumming Christoph Hellwig
2026-09-24 21:39   ` Darrick J. Wong
2026-09-25  5:53     ` Christoph Hellwig
2026-09-24  9:59 ` [PATCH 03/21] xfs: add a xfs_buf_read_async buffer cache API Christoph Hellwig
2026-09-24 21:43   ` Darrick J. Wong
2026-09-25  5:54     ` Christoph Hellwig
2026-09-24  9:59 ` [PATCH 04/21] xfs: add xfs_daddr_to_rgno and xfs_daddr_to_rgbno helpers Christoph Hellwig
2026-09-24 21:44   ` Darrick J. Wong
2026-09-24  9:59 ` [PATCH 05/21] xfs: introduce XFS_BLI_PREALLOC Christoph Hellwig
2026-09-24 21:49   ` Darrick J. Wong
2026-09-25  5:57     ` Christoph Hellwig
2026-10-08 11:46   ` Anuj gupta
2026-09-24  9:59 ` [PATCH 06/21] xfs: prepare xfs_rtfile_initialize_blocks for larger than FSB blocks Christoph Hellwig
2026-09-24 22:03   ` Darrick J. Wong
2026-09-25  5:58     ` Christoph Hellwig
2026-09-24  9:59 ` [PATCH 07/21] xfs: relase zi_open_zones_lock over xfs_open_zone_put on unmount Christoph Hellwig
2026-09-24  9:59 ` [PATCH 08/21] xfs: define the RT data checksum on-disk format Christoph Hellwig
2026-09-24 22:13   ` Darrick J. Wong
2026-09-25  0:04     ` Eric Biggers
2026-09-25  6:01     ` Christoph Hellwig
2026-09-24  9:59 ` [PATCH 09/21] xfs: add support for per-RTG csum files Christoph Hellwig
2026-09-24 22:24   ` Darrick J. Wong
2026-09-25  6:10     ` Christoph Hellwig [this message]
2026-09-24  9:59 ` [PATCH 10/21] xfs: calculate the log reservation for logging data checksum buffers Christoph Hellwig
2026-09-24 22:30   ` Darrick J. Wong
2026-09-25  6:12     ` Christoph Hellwig
2026-09-24  9:59 ` [PATCH 11/21] xfs: core RT data checksum support Christoph Hellwig
2026-09-25 23:20   ` Darrick J. Wong
2026-09-26  6:13     ` Christoph Hellwig
2026-09-24  9:59 ` [PATCH 12/21] xfs: data checksums require stable writes Christoph Hellwig
2026-09-25 23:21   ` Darrick J. Wong
2026-09-24  9:59 ` [PATCH 13/21] xfs: require file system block size alignment when using data checksums Christoph Hellwig
2026-09-25 23:24   ` Darrick J. Wong
2026-09-26  6:15     ` Christoph Hellwig
2026-09-24  9:59 ` [PATCH 14/21] xfs: add support for reading with " Christoph Hellwig
2026-09-29  0:42   ` Darrick J. Wong
2026-10-05 12:59     ` Christoph Hellwig
2026-09-24  9:59 ` [PATCH 15/21] xfs: add support for writing " Christoph Hellwig
2026-09-29  1:01   ` Darrick J. Wong
2026-10-05 13:00     ` Christoph Hellwig
2026-09-24  9:59 ` [PATCH 16/21] xfs: add data checksum support to zoned garbage collection Christoph Hellwig
2026-09-29  1:06   ` Darrick J. Wong
2026-10-05 13:11     ` Christoph Hellwig
2026-09-24  9:59 ` [PATCH 17/21] xfs: verify data checksums during media verification Christoph Hellwig
2026-09-29  1:19   ` Darrick J. Wong
2026-10-05 13:13     ` Christoph Hellwig
2026-09-24  9:59 ` [PATCH 18/21] xfs: don't try to verify checksums on empty zones Christoph Hellwig
2026-09-29  1:25   ` Darrick J. Wong
2026-10-05 13:14     ` Christoph Hellwig
2026-10-08 11:43   ` Anuj gupta
2026-09-24  9:59 ` [PATCH 19/21] xfs: report RT data checksum information via XFS_FSOP_GEOM Christoph Hellwig
2026-09-29  1:26   ` Darrick J. Wong
2026-09-24  9:59 ` [PATCH 20/21] xfs: add an experimental feature warning for RT data checksums Christoph Hellwig
2026-09-29  1:27   ` Darrick J. Wong
2026-09-24  9:59 ` [PATCH 21/21] xfs: enable " Christoph Hellwig
2026-09-29  1:27   ` Darrick J. Wong
2026-10-05 13:16     ` Christoph Hellwig
2026-09-24 22:52 ` support for " Dave Chinner
2026-09-25  6:27   ` Christoph Hellwig
2026-09-27 22:59     ` Dave Chinner
2026-09-28  5:24       ` Christoph Hellwig
2026-09-29 14:11         ` Dave Chinner
2026-09-30  7:11           ` Dave Chinner
2026-10-05 13:53             ` Christoph Hellwig
2026-10-06  5:31               ` Dave Chinner
2026-10-07 13:46                 ` 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=20260925061031.GF3193@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@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