linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: sandeen@sandeen.net, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 3/4] xfs_repair: factor phase transitions into a helper
Date: Mon, 22 Feb 2021 09:11:39 -0500	[thread overview]
Message-ID: <20210222141139.GC886774@bfoster> (raw)
In-Reply-To: <161370469026.2389661.9403286204851498334.stgit@magnolia>

On Thu, Feb 18, 2021 at 07:18:10PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Create a helper function to centralize all the stuff we do at the end of
> a repair phase (which for now is limited to reporting progress).  The
> next patch will add more interesting things to this helper.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---

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

>  repair/xfs_repair.c |   22 ++++++++++++++--------
>  1 file changed, 14 insertions(+), 8 deletions(-)
> 
> 
> diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c
> index 8eb7da53..891b3b23 100644
> --- a/repair/xfs_repair.c
> +++ b/repair/xfs_repair.c
> @@ -847,6 +847,12 @@ repair_capture_writeback(
>  	pthread_mutex_unlock(&wb_mutex);
>  }
>  
> +static inline void
> +phase_end(int phase)
> +{
> +	timestamp(PHASE_END, phase, NULL);
> +}
> +
>  int
>  main(int argc, char **argv)
>  {
> @@ -876,7 +882,7 @@ main(int argc, char **argv)
>  	msgbuf = malloc(DURATION_BUF_SIZE);
>  
>  	timestamp(PHASE_START, 0, NULL);
> -	timestamp(PHASE_END, 0, NULL);
> +	phase_end(0);
>  
>  	/* -f forces this, but let's be nice and autodetect it, as well. */
>  	if (!isa_file) {
> @@ -899,7 +905,7 @@ main(int argc, char **argv)
>  
>  	/* do phase1 to make sure we have a superblock */
>  	phase1(temp_mp);
> -	timestamp(PHASE_END, 1, NULL);
> +	phase_end(1);
>  
>  	if (no_modify && primary_sb_modified)  {
>  		do_warn(_("Primary superblock would have been modified.\n"
> @@ -1125,23 +1131,23 @@ main(int argc, char **argv)
>  
>  	/* make sure the per-ag freespace maps are ok so we can mount the fs */
>  	phase2(mp, phase2_threads);
> -	timestamp(PHASE_END, 2, NULL);
> +	phase_end(2);
>  
>  	if (do_prefetch)
>  		init_prefetch(mp);
>  
>  	phase3(mp, phase2_threads);
> -	timestamp(PHASE_END, 3, NULL);
> +	phase_end(3);
>  
>  	phase4(mp);
> -	timestamp(PHASE_END, 4, NULL);
> +	phase_end(4);
>  
>  	if (no_modify)
>  		printf(_("No modify flag set, skipping phase 5\n"));
>  	else {
>  		phase5(mp);
>  	}
> -	timestamp(PHASE_END, 5, NULL);
> +	phase_end(5);
>  
>  	/*
>  	 * Done with the block usage maps, toss them...
> @@ -1151,10 +1157,10 @@ main(int argc, char **argv)
>  
>  	if (!bad_ino_btree)  {
>  		phase6(mp);
> -		timestamp(PHASE_END, 6, NULL);
> +		phase_end(6);
>  
>  		phase7(mp, phase2_threads);
> -		timestamp(PHASE_END, 7, NULL);
> +		phase_end(7);
>  	} else  {
>  		do_warn(
>  _("Inode allocation btrees are too corrupted, skipping phases 6 and 7\n"));
> 


  parent reply	other threads:[~2021-02-22 14:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-19  3:17 [PATCHSET v2 0/4] xfs_repair: set needsrepair when dirtying filesystems Darrick J. Wong
2021-02-19  3:17 ` [PATCH 1/4] xfs_repair: set NEEDSREPAIR the first time we write to a filesystem Darrick J. Wong
2021-02-20  0:32   ` Eric Sandeen
2021-02-20  0:47     ` Darrick J. Wong
2021-02-22 14:11   ` Brian Foster
2021-02-19  3:18 ` [PATCH 2/4] libxfs: simulate system failure after a certain number of writes Darrick J. Wong
2021-02-20  0:51   ` Eric Sandeen
2021-02-20  1:15     ` Darrick J. Wong
2021-02-22 14:11   ` Brian Foster
2021-02-19  3:18 ` [PATCH 3/4] xfs_repair: factor phase transitions into a helper Darrick J. Wong
2021-02-20  0:58   ` Eric Sandeen
2021-02-22 14:11   ` Brian Foster [this message]
2021-02-19  3:18 ` [PATCH 4/4] xfs_repair: add post-phase error injection points Darrick J. Wong
2021-02-20  1:00   ` Eric Sandeen
2021-02-22 14:11   ` Brian Foster
2021-02-23  3:01 [PATCHSET v3 0/4] xfs_repair: set needsrepair when dirtying filesystems Darrick J. Wong
2021-02-23  3:01 ` [PATCH 3/4] xfs_repair: factor phase transitions into a helper Darrick J. Wong
2021-02-24  5:39   ` Allison Henderson
2021-02-25  8:18   ` 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=20210222141139.GC886774@bfoster \
    --to=bfoster@redhat.com \
    --cc=djwong@kernel.org \
    --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).