linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 3/4] xfs_repair: refactor attr root block pointer check
Date: Thu, 13 Feb 2020 20:24:38 -0800	[thread overview]
Message-ID: <20200214042438.GH6870@magnolia> (raw)
In-Reply-To: <dc1d5144-4438-2d3c-61b8-70ff80c0fa33@sandeen.net>

On Thu, Feb 13, 2020 at 05:14:57PM -0600, Eric Sandeen wrote:
> On 2/4/20 6:46 PM, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > In process_longform_attr, replace the agcount check with a call to the
> > fsblock verification function in libxfs.  Now we can also catch blocks
> > that point to static FS metadata.
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> >  repair/attr_repair.c |   10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > 
> > diff --git a/repair/attr_repair.c b/repair/attr_repair.c
> > index 9a44f610..7b26df33 100644
> > --- a/repair/attr_repair.c
> > +++ b/repair/attr_repair.c
> > @@ -980,21 +980,21 @@ process_longform_attr(
> >  	*repair = 0;
> >  
> >  	bno = blkmap_get(blkmap, 0);
> > -
> > -	if ( bno == NULLFSBLOCK ) {
> > +	if (bno == NULLFSBLOCK) {
> >  		if (dip->di_aformat == XFS_DINODE_FMT_EXTENTS &&
> >  				be16_to_cpu(dip->di_anextents) == 0)
> >  			return(0); /* the kernel can handle this state */
> >  		do_warn(
> >  	_("block 0 of inode %" PRIu64 " attribute fork is missing\n"),
> >  			ino);
> > -		return(1);
> > +		return 1;
> >  	}
> > +
> >  	/* FIX FOR bug 653709 -- EKN */
> > -	if (mp->m_sb.sb_agcount < XFS_FSB_TO_AGNO(mp, bno)) {
> > +	if (!xfs_verify_fsbno(mp, bno)) {
> >  		do_warn(
> >  	_("agno of attribute fork of inode %" PRIu64 " out of regular partition\n"), ino);
> 
> I'll change this to
> 
> "block in attribute fork of inode %" PRIu64 " is not valid"

Sounds good!

--D

> ok?
> 
> > -		return(1);
> > +		return 1;
> >  	}
> >  
> >  	bp = libxfs_readbuf(mp->m_dev, XFS_FSB_TO_DADDR(mp, bno),
> > 

  reply	other threads:[~2020-02-14  4:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05  0:46 [PATCH 0/4] xfsprogs: random fixes Darrick J. Wong
2020-02-05  0:46 ` [PATCH 1/4] libxfs: re-sort libxfs_api_defs.h defines Darrick J. Wong
2020-02-05  2:11   ` Chaitanya Kulkarni
2020-02-05  5:28   ` Allison Collins
2020-02-17 13:45   ` Christoph Hellwig
2020-02-05  0:46 ` [PATCH 2/4] libfrog: remove libxfs.h dependencies in fsgeom.c and linux.c Darrick J. Wong
2020-02-05  5:28   ` Allison Collins
2020-02-17 13:46   ` Christoph Hellwig
2020-02-05  0:46 ` [PATCH 3/4] xfs_repair: refactor attr root block pointer check Darrick J. Wong
2020-02-05  5:28   ` Allison Collins
2020-02-13 23:14   ` Eric Sandeen
2020-02-14  4:24     ` Darrick J. Wong [this message]
2020-02-17 13:47   ` Christoph Hellwig
2020-02-05  0:46 ` [PATCH 4/4] xfs_repair: don't corrupt a attr fork da3 node when clearing forw/back Darrick J. Wong
2020-02-05  5:29   ` Allison Collins
2020-02-05  5:59     ` Darrick J. Wong
2020-02-17 13:48   ` Christoph Hellwig

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=20200214042438.GH6870@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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).