public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: "Darrick J. Wong" <djwong@kernel.org>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: verify buffer contents when we skip log replay
Date: Thu, 13 Apr 2023 07:40:34 +1000	[thread overview]
Message-ID: <20230412214034.GL3223426@dread.disaster.area> (raw)
In-Reply-To: <ZDahf6XEA2trj7sQ@infradead.org>

On Wed, Apr 12, 2023 at 05:18:07AM -0700, Christoph Hellwig wrote:
> On Tue, Apr 11, 2023 at 04:31:59PM -0700, Darrick J. Wong wrote:
> > Unfortunately, the ondisk buffer is corrupt, but recovery just read the
> > buffer with no buffer ops specified:
> > 
> > 	error = xfs_buf_read(mp->m_ddev_targp, buf_f->blf_blkno,
> > 			buf_f->blf_len, buf_flags, &bp, NULL);
> 
> > +
> > +		/*
> > +		 * We're skipping replay of this buffer log item due to the log
> > +		 * item LSN being behind the ondisk buffer.  Verify the buffer
> > +		 * contents since we aren't going to run the write verifier.
> > +		 */
> > +		if (bp->b_ops) {
> > +			bp->b_ops->verify_read(bp);
> > +			error = bp->b_error;
> > +		}
> 
> How do we end up with ops attached here if xfs_buf_read doesn't
> attach them?  The buf type specific recover routines later attach
> ops, but this is called before we reach them.

The line of context above this hunk you cut out does exactly
that. i.e. this call:

		xlog_recover_validate_buf_type(mp, bp, buf_f, NULLCOMMITLSN);

-Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2023-04-12 21:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11 23:31 [PATCH] xfs: verify buffer contents when we skip log replay Darrick J. Wong
2023-04-11 23:53 ` Dave Chinner
2023-04-12 12:18 ` Christoph Hellwig
2023-04-12 21:40   ` Dave Chinner [this message]
2023-06-01 13:03 ` Lee Jones
2023-06-01 15:11   ` Darrick J. Wong
2023-06-02 10:16     ` Amir Goldstein
2023-06-02 19:17       ` Leah Rumancik
2023-06-06 16:56         ` Lee Jones
2023-06-06 17:28           ` Leah Rumancik
2023-06-07  9:09             ` Lee Jones
2023-06-04  5:51     ` Amir Goldstein
2023-06-04 18:32       ` Darrick J. Wong

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=20230412214034.GL3223426@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=hch@infradead.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