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: sandeen@redhat.com, linux-xfs@vger.kernel.org
Subject: Re: [PATCH v2 4/5] xfs_repair: zero shared_vn
Date: Fri, 20 Jan 2017 16:08:05 -0800	[thread overview]
Message-ID: <20170121000804.GI12985@birch.djwong.org> (raw)
In-Reply-To: <9307d194-d679-20c6-e83c-ac7fb38e467e@sandeen.net>

On Fri, Jan 20, 2017 at 05:08:37PM -0600, Eric Sandeen wrote:
> On 1/20/17 4:52 PM, Darrick J. Wong wrote:
> > Since shared_vn always has to be zero, zero it at the end of repair.
>                                                  ^^^^^^^^^^^^^^^^^^^^
> 
> Or at the beginning ;)

"...at the start of repair."

> 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> > v2: reset shared_vn in phase 1 and tell the user about it, per sandeen
> > ---
> >  repair/phase1.c |   11 +++++++++++
> >  1 file changed, 11 insertions(+)
> > 
> > diff --git a/repair/phase1.c b/repair/phase1.c
> > index 126d0b3..ee5d3d7 100644
> > --- a/repair/phase1.c
> > +++ b/repair/phase1.c
> > @@ -138,6 +138,17 @@ _("Cannot disable lazy-counters on V5 fs\n"));
> >  		}
> >  	}
> >  
> > +	/* shared_vn should be zero */
> > +	if (sb->sb_shared_vn) {
> > +		if (!no_modify)  {
> > +			do_warn(_("resetting shared_vn to zero\n"));
> > +			sb->sb_shared_vn = 0;
> > +			primary_sb_modified = 1;
> > +		} else  {
> > +			do_warn(_("would reset shared_vn to zero\n"));
> > +		}
> > +	}
> > +
> 
> No other test has the if/else on no modify, they simply say what the problem
> is, "correcting" etc, but at the /end/ it says whether or not it's written out:
> 
>         if (primary_sb_modified)  {
>                 if (!no_modify)  {
>                         do_warn(_("writing modified primary superblock\n"));
>                         write_primary_sb(sb, sb->sb_sectsize);
>                 } else  {
>                         do_warn(_("would write modified primary superblock\n"));
>                 }
>         }
> 

Many of the repairs in later phases /do/ use this paradigm, though none
in this function do that.  I don't really care one way or the other, so
I'll change it to:

> So I think just something like:
> 
> +	if (sb->sb_shared_vn) {
> +		do_warn(_("superblock has invalid shared_vn, resetting\n"));
> +		sb->sb_shared_vn = 0;
> +		primary_sb_modified = 1;
> +	}
> 
> would suffice.

--D

> 
> -Eric
> 
> >  	if (primary_sb_modified)  {
> >  		if (!no_modify)  {
> >  			do_warn(_("writing modified primary superblock\n"));
> > --
> > 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
> > 
> --
> 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:[~2017-01-21  0:08 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-20 20:25 [PATCH 0/5] xfsprogs: miscellaneous cleanups Darrick J. Wong
2017-01-20 20:25 ` [PATCH 1/5] xfs_db: sanitize geometry on load Darrick J. Wong
2017-01-20 23:33   ` Eric Sandeen
2017-01-21  0:15   ` [PATCH v5 " Darrick J. Wong
2017-01-23 20:02     ` Eric Sandeen
2017-01-23 20:35       ` Darrick J. Wong
2017-01-23 21:30     ` Darrick J. Wong
2017-01-23 21:31   ` [PATCH v6 " Darrick J. Wong
2017-01-24 22:38     ` Eric Sandeen
2017-01-24 22:52     ` [PATCH v7 1/5] xfs_db: sanitize agcount " Eric Sandeen
2017-01-25  0:21       ` Darrick J. Wong
2017-01-25  0:55         ` Eric Sandeen
2017-01-25  3:09       ` [PATCH v8 " Eric Sandeen
2017-01-25  4:48         ` Darrick J. Wong
2017-01-26  1:05         ` [PATCH v9 " Eric Sandeen
2017-01-26  1:17           ` [PATCH v10 " Eric Sandeen
2017-01-26  1:27             ` Darrick J. Wong
2017-01-20 20:25 ` [PATCH 2/5] xfs_db: fix the 'source' command when passed as a -c option Darrick J. Wong
2017-01-23 22:29   ` Eric Sandeen
2017-01-23 23:39     ` Darrick J. Wong
2017-01-23 23:41   ` [PATCH v2 " Darrick J. Wong
2017-01-20 20:25 ` [PATCH 3/5] xfs_repair: strengthen geometry checks Darrick J. Wong
2017-01-23 23:47   ` Eric Sandeen
2017-01-24  0:13     ` Darrick J. Wong
2017-01-24  0:29       ` Eric Sandeen
2017-01-24  0:55   ` [PATCH v2 " Darrick J. Wong
2017-01-20 20:25 ` [PATCH 4/5] xfs_repair: zero shared_vn Darrick J. Wong
2017-01-20 22:20   ` Eric Sandeen
2017-01-20 22:51     ` Darrick J. Wong
2017-01-20 22:52   ` [PATCH v2 " Darrick J. Wong
2017-01-20 23:08     ` Eric Sandeen
2017-01-21  0:08       ` Darrick J. Wong [this message]
2017-01-21  0:09   ` [PATCH v3 " Darrick J. Wong
2017-01-24  2:38     ` Eric Sandeen
2017-01-20 20:25 ` [PATCH 5/5] xfs_repair: trash dirattr btrees that cycle to the root Darrick J. Wong
2017-01-24  3:03   ` Eric Sandeen

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=20170121000804.GI12985@birch.djwong.org \
    --to=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --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).