From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp2130.oracle.com ([156.151.31.86]:58710 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753070AbeCFR1T (ORCPT ); Tue, 6 Mar 2018 12:27:19 -0500 Date: Tue, 6 Mar 2018 09:27:11 -0800 From: "Darrick J. Wong" Subject: Re: [PATCH 04/16] xfs_scrub: don't ask user to run xfs_repair for only warnings Message-ID: <20180306172711.GG18989@magnolia> References: <151993157539.22223.6269629008244777191.stgit@magnolia> <151993160036.22223.2742740914776483127.stgit@magnolia> <63982341-7cce-68c0-144c-b24b279ddc3f@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <63982341-7cce-68c0-144c-b24b279ddc3f@sandeen.net> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Eric Sandeen Cc: sandeen@redhat.com, linux-xfs@vger.kernel.org, djwong@kernel.org On Tue, Mar 06, 2018 at 11:16:50AM -0600, Eric Sandeen wrote: > > > On 3/1/18 1:13 PM, Darrick J. Wong wrote: > > From: Darrick J. Wong > > > > Don't advise the user to run xfs_repair on a filesystem that triggers > > warnings but no errors; there's no corruption for it to fix. > > > > Signed-off-by: Darrick J. Wong > > I went looking for why ->need_repair is set if repair isn't needed, and: > > C symbol: need_repair > > File Function Line > 0 scrub/xfs_scrub.h 98 bool need_repair; > 1 scrub/phase1.c xfs_setup_fs 239 ctx->need_repair = true; > 2 scrub/xfs_scrub.c report_outcome 517 if (ctx->need_repair) > > um, when is ->need_repair ever false? What am I missing? In main(): struct scrub_ctx ctx = {0}; ctx.need_repair is false from the start of the program until the end of phase 1 when we've decided that yes we can check this xfs filesystem. --D > > --- > > scrub/xfs_scrub.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c > > index ab26e63..53a105a 100644 > > --- a/scrub/xfs_scrub.c > > +++ b/scrub/xfs_scrub.c > > @@ -514,7 +514,7 @@ report_outcome( > > fprintf(stderr, _("%s: errors found: %llu; warnings found: %llu\n"), > > ctx->mntpoint, total_errors, > > ctx->warnings_found); > > - if (ctx->need_repair) > > + if (ctx->need_repair && total_errors > 0) > > fprintf(stderr, _("%s: Unmount and run xfs_repair.\n"), > > ctx->mntpoint); > > } > > > > -- > > 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