All of lore.kernel.org
 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>,
	linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/9] xfs: add a on-disk log header cycle array accessor
Date: Wed, 15 Oct 2025 06:32:38 +0200	[thread overview]
Message-ID: <20251015043238.GA7253@lst.de> (raw)
In-Reply-To: <20251014212717.GH6188@frogsfrogsfrogs>

On Tue, Oct 14, 2025 at 02:27:17PM -0700, Darrick J. Wong wrote:
> > @@ -1543,14 +1538,6 @@ xlog_pack_data(
> >  	if (xfs_has_logv2(log->l_mp)) {
> >  		xlog_in_core_2_t *xhdr = iclog->ic_data;
> >  
> > -		for ( ; i < BTOBB(size); i++) {
> > -			j = i / XLOG_CYCLE_DATA_SIZE;
> > -			k = i % XLOG_CYCLE_DATA_SIZE;
> > -			xhdr[j].hic_xheader.xh_cycle_data[k] = *(__be32 *)dp;
> > -			*(__be32 *)dp = cycle_lsn;
> > -			dp += BBSIZE;
> > -		}
> 
> Just to orient myself -- this is the code that stamps (swazzled) LSN
> cycle numbers into the log headers, right?

Yes.

> > +static inline __be32 *xlog_cycle_data(struct xlog_rec_header *rhead, unsigned i)
> > +{
> > +	if (i >= XLOG_CYCLE_DATA_SIZE) {
> 
> Does this need a xfs_has_logv2() check?  The old callsites all seem to
> have them.
> 
> What should happen if i >= XLOG_CYCLE_DATA_SIZE && !logv2 ?  Should
> this helper return NULL so that callers can return EFSCORRUPTED or
> something like that?

It can't happen.  It is bound by l_iclog_hsize or h_len, which
can't go into the subsequent blocks for v1 logs.  For the recovery
case we also check for h_len being smaller than h_size, and h_size
is fixed to XLOG_BIG_RECORD_BSIZE for v1 logs.


  reply	other threads:[~2025-10-15  4:32 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 [this message]
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
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 2/9] xfs: add a on-disk log header cycle array accessor Christoph Hellwig
2025-10-31 13:38   ` 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=20251015043238.GA7253@lst.de \
    --to=hch@lst.de \
    --cc=cem@kernel.org \
    --cc=djwong@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 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.