public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Brian Foster <bfoster@redhat.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH v2] xfs: handle dquot buffer readahead in log recovery correctly
Date: Fri, 8 Jan 2016 10:55:58 +1100	[thread overview]
Message-ID: <20160107235558.GP21461@dastard> (raw)
In-Reply-To: <20160107124433.GA33327@bfoster.bfoster>

[slightly hacked up quoting order so it makes sense]

On Thu, Jan 07, 2016 at 07:44:33AM -0500, Brian Foster wrote:
> On Thu, Jan 07, 2016 at 02:08:30PM +1100, Dave Chinner wrote:
> > 
> > From: Dave Chinner <dchinner@redhat.com>
> > 
> > When we do dquot readahead in log recovery, we do not use a verifier
......
> > write operation as well as a read operation that marks the buffer as
> > not done if any corruption is detected.  Also make sure we don't run

Marking the buffer not done mentioned here...

.....
> >  
> >  /*
> > + * readahead errors are silent and simply leave the buffer as !done so a real
> > + * read will then be run with the xfs_dquot_buf_ops verifier. See
> > + * xfs_inode_buf_verify() for why we use EIO and ~XBF_DONE here rather than
> > + * reporting the failure.

... and here ...

> > @@ -62,11 +62,14 @@ xfs_inobp_check(
> >   * has not had the inode cores stamped into it. Hence for readahead, the buffer
> >   * may be potentially invalid.
> >   *
> > - * If the readahead buffer is invalid, we don't want to mark it with an error,
> > - * but we do want to clear the DONE status of the buffer so that a followup read
> > - * will re-read it from disk. This will ensure that we don't get an unnecessary
> > - * warnings during log recovery and we don't get unnecssary panics on debug
> > - * kernels.
> > + * If the readahead buffer is invalid, we need to mark it with an error and
> > + * clear the DONE status of the buffer so that a followup read will re-read it
> > + * from disk. We don't report the error otherwise to avoid warnings during log

... and here ...

> Do we really need to clear the flag if the I/O infrastructure doesn't
> set it until after the verifier is invoked?  It's harmless, [...]
> ... but it does look slightly confusing, without a mention in the
> comments at least.

I mentioned it 3 times. ;)

Is there something I can do to make it more obvious what the
comments are referring to?

> > + */
> > +static void
> > +xfs_dquot_buf_readahead_verify(
> > +	struct xfs_buf	*bp)
> > +{
> > +	struct xfs_mount	*mp = bp->b_target->bt_mount;
> > +
> > +	if (!xfs_dquot_buf_verify_crc(mp, bp) ||
> > +	    !xfs_dquot_buf_verify(mp, bp, 0)) {
> > +		xfs_buf_ioerror(bp, -EIO);
> > +		bp->b_flags &= ~XBF_DONE;
> 
> Do we really need to clear the flag if the I/O infrastructure doesn't
> set it until after the verifier is invoked?  It's harmless, so if the
> intent is to just be cautious or future-proof:

It's intended to cover the case that a verifier is run on a buffer
that has already been read in successfully. This doesn't occur in
the kernel code, but it most definitely does in the userspace code.
Strictly speaking it's not necessary (at the moment) for the
userspace code as it ignores the kernel buffer flags, but I figured
it's better to leave it there for documentation of expected
behaviour and to ensure we don't leave a landmine if we ever run a
readahead verifier on a buffer that is already marked as done...

> Reviewed-by: Brian Foster <bfoster@redhat.com>

Thanks!

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2016-01-07 23:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-06  4:00 [PATCH] xfs: handle dquot buffer readahead in log recovery correctly Dave Chinner
2016-01-06 14:34 ` Brian Foster
2016-01-06 22:24   ` Dave Chinner
2016-01-06 16:16 ` Arkadiusz Miśkiewicz
2016-01-07  3:08 ` [PATCH v2] " Dave Chinner
2016-01-07 12:44   ` Brian Foster
2016-01-07 23:55     ` Dave Chinner [this message]
2016-01-08 12:39       ` Brian Foster

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=20160107235558.GP21461@dastard \
    --to=david@fromorbit.com \
    --cc=bfoster@redhat.com \
    --cc=xfs@oss.sgi.com \
    /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