All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 07/20] xfs: refactor verifier callers to print address of failing check
Date: Tue, 2 Jan 2018 16:09:17 -0800	[thread overview]
Message-ID: <20180103000917.GI4857@magnolia> (raw)
In-Reply-To: <20180102234423.GB5858@dastard>

On Wed, Jan 03, 2018 at 10:44:23AM +1100, Dave Chinner wrote:
> On Fri, Dec 22, 2017 at 05:07:48PM -0800, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > Refactor the callers of verifiers to print the instruction address of a
> > failing check.
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> .....
> > @@ -2455,13 +2461,16 @@ xfs_agf_read_verify(
> >  	struct xfs_buf	*bp)
> >  {
> >  	struct xfs_mount *mp = bp->b_target->bt_mount;
> > +	xfs_failaddr_t	fa;
> >  
> >  	if (xfs_sb_version_hascrc(&mp->m_sb) &&
> >  	    !xfs_buf_verify_cksum(bp, XFS_AGF_CRC_OFF))
> > -		xfs_verifier_error(bp, -EFSBADCRC);
> > -	else if (XFS_TEST_ERROR(xfs_agf_verify(mp, bp), mp,
> > -				XFS_ERRTAG_ALLOC_READ_AGF))
> > -		xfs_verifier_error(bp, -EFSCORRUPTED);
> > +		xfs_verifier_error(bp, -EFSBADCRC, __this_address);
> > +	else {
> > +		fa = xfs_agf_verify(mp, bp);
> > +		if (XFS_TEST_ERROR(fa, mp, XFS_ERRTAG_ALLOC_READ_AGF))
> > +			xfs_verifier_error(bp, -EFSCORRUPTED, fa);
> > +	}
> >  }
> 
> That's much nicer than the last iteration :)
> 
> .....
> 
> > diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c
> > index c0a98c4..7e58a99 100644
> > --- a/fs/xfs/xfs_error.c
> > +++ b/fs/xfs/xfs_error.c
> > @@ -348,15 +348,18 @@ xfs_corruption_error(
> >  void
> >  xfs_verifier_error(
> >  	struct xfs_buf		*bp,
> > -	int			error)
> > +	int			error,
> > +	xfs_failaddr_t		failaddr)
> >  {
> >  	struct xfs_mount *mp = bp->b_target->bt_mount;
> > +	xfs_failaddr_t		fa;
> >  
> > -	__xfs_buf_ioerror(bp, error, __return_address);
> > +	fa = failaddr ? failaddr : __return_address;
> > +	__xfs_buf_ioerror(bp, error, failaddr);
> 
> I'm a little unsure of this. Why pass failaddr to
> __xfs_buf_ioerror() rather than fa?

Oops.  Yeah, that should be fa, not failaddr.

--D

> Otherwise, everything looks good.
> 
> Reviewed-by: Dave Chinner <dchinner@redhat.com>
> -- 
> Dave Chinner
> david@fromorbit.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2018-01-03  0:09 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-23  1:07 [PATCH v3 00/20] xfs: more and better verifiers Darrick J. Wong
2017-12-23  1:07 ` [PATCH 01/20] xfs: remove XFS_FSB_SANITY_CHECK Darrick J. Wong
2018-01-02 23:11   ` Dave Chinner
2017-12-23  1:07 ` [PATCH 02/20] xfs: refactor long-format btree header verification routines Darrick J. Wong
2018-01-02 23:15   ` Dave Chinner
2017-12-23  1:07 ` [PATCH 03/20] xfs: refactor short form btree pointer verification Darrick J. Wong
2018-01-02 23:17   ` Dave Chinner
2017-12-23  1:07 ` [PATCH 04/20] xfs: remove XFS_WANT_CORRUPTED_RETURN from dir3 data verifiers Darrick J. Wong
2017-12-23  1:07 ` [PATCH 05/20] xfs: refactor xfs_verifier_error and xfs_buf_ioerror Darrick J. Wong
2018-01-02 23:22   ` Dave Chinner
2017-12-23  1:07 ` [PATCH 06/20] xfs: have buffer verifier functions report failing address Darrick J. Wong
2018-01-02 23:36   ` Dave Chinner
2017-12-23  1:07 ` [PATCH 07/20] xfs: refactor verifier callers to print address of failing check Darrick J. Wong
2018-01-02 23:44   ` Dave Chinner
2018-01-03  0:09     ` Darrick J. Wong [this message]
2017-12-23  1:07 ` [PATCH 08/20] xfs: verify dinode header first Darrick J. Wong
2017-12-23  1:08 ` [PATCH 09/20] xfs: move inode fork verifiers to xfs_dinode_verify Darrick J. Wong
2017-12-23  1:08 ` [PATCH 10/20] xfs: create structure verifier function for shortform xattrs Darrick J. Wong
2018-01-02 23:53   ` Dave Chinner
2017-12-23  1:08 ` [PATCH 11/20] xfs: create structure verifier function for short form symlinks Darrick J. Wong
2017-12-23  1:08 ` [PATCH 12/20] xfs: refactor short form directory structure verifier function Darrick J. Wong
2017-12-23  1:08 ` [PATCH 13/20] xfs: provide a centralized method for verifying inline fork data Darrick J. Wong
2018-01-03  0:32   ` Dave Chinner
2017-12-23  1:08 ` [PATCH 14/20] xfs: fail out of xfs_attr3_leaf_lookup_int if it looks corrupt Darrick J. Wong
2017-12-23  1:08 ` [PATCH 15/20] xfs: create a new buf_ops pointer to verify structure metadata Darrick J. Wong
2018-01-03  0:35   ` Dave Chinner
2017-12-23  1:08 ` [PATCH 16/20] xfs: scrub in-core metadata Darrick J. Wong
2017-12-23  1:08 ` [PATCH 17/20] xfs: separate dquot repair into a separate function Darrick J. Wong
2018-01-03  0:39   ` Dave Chinner
2017-12-23  1:08 ` [PATCH 18/20] xfs: standardize quota verification function outputs Darrick J. Wong
2018-01-03  0:44   ` Dave Chinner
2018-01-03  0:52     ` Darrick J. Wong
2017-12-23  1:09 ` [PATCH 19/20] xfs: teach error reporting functions to take xfs_failaddr_t Darrick J. Wong
2018-01-03  0:44   ` Dave Chinner
2017-12-23  1:09 ` [PATCH 20/20] xfs: dump the first 128 bytes of any corrupt buffer Darrick J. Wong
2018-01-03  0:49   ` Dave Chinner

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=20180103000917.GI4857@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --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.