linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Carlos Maiolino <cem@kernel.org>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 6/9] xfs: remove xlog_in_core_2_t
Date: Wed, 15 Oct 2025 13:27:02 -0700	[thread overview]
Message-ID: <20251015202702.GG6188@frogsfrogsfrogs> (raw)
In-Reply-To: <20251015044109.GD7253@lst.de>

On Wed, Oct 15, 2025 at 06:41:09AM +0200, Christoph Hellwig wrote:
> On Tue, Oct 14, 2025 at 03:07:57PM -0700, Darrick J. Wong wrote:
> > > +	__be32		xh_cycle_data[XLOG_CYCLE_DATA_SIZE];
> > > +	__u8		xh_reserved[252];
> > 
> > Just out of curiosity, why do we reserve so much space at the end of the
> > extended header?  Wouldn't it have been more efficient to fill all 508
> > bytes with xh_cycle_data?
> 
> That's something I asked myself when doing this as well.  Or if we're
> so inefficient, why don't we at least put the cycle data into the same
> offset for both the initial and extended headers.  Also why do we write
> xh_cycle into the extended header and don't every read it?

Oh well, log v3 then. :(

> > > +
> > > +	__u8	  h_reserved[184];
> > > +	struct xlog_rec_ext_header h_ext[];
> > 
> > Ok, so you're explicitly padding struct xlog_rec_header and
> > xlog_rec_ext_header to be 512 bytes now, and making the xlog_rec_header
> > have a VLA of xlog_rec_ext_header.
> 
> Yes.
> 
> > The log buffer crc is computed from the start of xlog_rec_header::h_crc
> > to the end(ish) of the xlog_rec_header; and the first 256 bytes of each
> > xlog_rec_ext_header, right?
> 
> Yes.
> 
> > > +++ b/fs/xfs/xfs_log.c
> > > @@ -1526,12 +1526,8 @@ xlog_pack_data(
> > >  		dp += BBSIZE;
> > >  	}
> > >  
> > > -	if (xfs_has_logv2(log->l_mp)) {
> > 
> > Is the xfs_has_logv2 still necessary here?
> > 
> > What happens if log->l_iclog_heads > 1 && !logv2?  Or has the kernel
> > already checked for that and aborted the mount?
> 
> l_iclog_heads is set based on m_logbsize, and xfs_finish_flags verifies
> that it is never bigger than XLOG_BIG_RECORD_BSIZE for v1 logs.

Sounds good to me!
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D


  reply	other threads:[~2025-10-15 20:27 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-13  2:42 kill xlog_in_core_2_t v2 Christoph Hellwig
2025-10-13  2:42 ` [PATCH 1/9] xfs: add a XLOG_CYCLE_DATA_SIZE constant Christoph Hellwig
2025-10-14 21:16   ` Darrick J. Wong
2025-10-13  2:42 ` [PATCH 2/9] xfs: add a on-disk log header cycle array accessor Christoph Hellwig
2025-10-14 21:27   ` Darrick J. Wong
2025-10-15  4:32     ` Christoph Hellwig
2025-10-15 20:25       ` Darrick J. Wong
2025-10-13  2:42 ` [PATCH 3/9] xfs: don't use xlog_in_core_2_t in struct xlog_in_core Christoph Hellwig
2025-10-14 21:47   ` Darrick J. Wong
2025-10-15  4:34     ` Christoph Hellwig
2025-10-15 20:26       ` Darrick J. Wong
2025-10-13  2:42 ` [PATCH 4/9] xfs: cleanup xlog_alloc_log a bit Christoph Hellwig
2025-10-14 21:48   ` Darrick J. Wong
2025-10-13  2:42 ` [PATCH 5/9] xfs: remove a very outdated comment from xlog_alloc_log Christoph Hellwig
2025-10-14 21:52   ` Darrick J. Wong
2025-10-15  4:37     ` Christoph Hellwig
2025-10-13  2:42 ` [PATCH 6/9] xfs: remove xlog_in_core_2_t Christoph Hellwig
2025-10-14 22:07   ` Darrick J. Wong
2025-10-15  4:41     ` Christoph Hellwig
2025-10-15 20:27       ` Darrick J. Wong [this message]
2025-10-13  2:42 ` [PATCH 7/9] xfs: remove the xlog_rec_header_t typedef Christoph Hellwig
2025-10-14 22:08   ` Darrick J. Wong
2025-10-13  2:42 ` [PATCH 8/9] xfs: remove l_iclog_heads Christoph Hellwig
2025-10-14 22:12   ` Darrick J. Wong
2025-10-13  2:42 ` [PATCH 9/9] xfs: remove the xlog_in_core_t typedef Christoph Hellwig
2025-10-14 22:12   ` Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2025-10-27  7:05 kill xlog_in_core_2_t v3 Christoph Hellwig
2025-10-27  7:05 ` [PATCH 6/9] xfs: remove xlog_in_core_2_t Christoph Hellwig
2025-10-31 14: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=20251015202702.GG6188@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=cem@kernel.org \
    --cc=hch@lst.de \
    --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;
as well as URLs for NNTP newsgroup(s).