public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Bill O'Donnell <billodo@redhat.com>
To: Donald Douwsma <ddouwsma@redhat.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs_repair: always print an estimate when reporting progress
Date: Fri, 9 Jun 2023 10:03:05 -0500	[thread overview]
Message-ID: <ZIM/KegChkoeTJE8@redhat.com> (raw)
In-Reply-To: <20230531064143.1737591-1-ddouwsma@redhat.com>

On Wed, May 31, 2023 at 04:41:43PM +1000, Donald Douwsma wrote:
> If xfs_repair completes the work for a given phase while allocation
> groups are still being processed the estimated time may be zero, when
> this occures xfs_repair prints an incomplete string.
> 
>  # xfs_repair -o ag_stride=4 -t 1 /dev/sdc
>  Phase 1 - find and verify superblock...
>          - reporting progress in intervals of 1 second
>  Phase 2 - using internal log
>          - zero log...
>          - 20:52:11: zeroing log - 0 of 2560 blocks done
>          - 20:52:12: zeroing log - 2560 of 2560 blocks done
>          - scan filesystem freespace and inode maps...
>          - 20:52:12: scanning filesystem freespace - 3 of 4 allocation groups done
>          - 20:52:13: scanning filesystem freespace - 4 of 4 allocation groups done
>          - found root inode chunk
>  Phase 3 - for each AG...
>          - scan and clear agi unlinked lists...
>          - 20:52:13: scanning agi unlinked lists - 4 of 4 allocation groups done
>          - process known inodes and perform inode discovery...
>          - agno = 0
>          - 20:52:13: process known inodes and inode discovery - 3456 of 40448 inodes done
>          - 20:52:14: process known inodes and inode discovery - 3456 of 40448 inodes done
>          - 20:52:14: Phase 3: elapsed time 1 second - processed 207360 inodes per minute
>          - 20:52:14: Phase 3: 8% done - estimated remaining time 10 seconds
>          - 20:52:15: process known inodes and inode discovery - 3456 of 40448 inodes done
>          - 20:52:15: Phase 3: elapsed time 2 seconds - processed 103680 inodes per minute
>          - 20:52:15: Phase 3: 8% done - estimated remaining time 21 seconds
>          - 20:52:16: process known inodes and inode discovery - 33088 of 40448 inodes done
>          - 20:52:16: Phase 3: elapsed time 3 seconds - processed 661760 inodes per minute
>          - 20:52:16: Phase 3: 81% done - estimated remaining time
>          - agno = 1
>  	...
> 
> Make this more consistent by printing 'estimated remaining time 0
> seconds' if there is a 0 estimate.
> 
> Signed-off-by: Donald Douwsma <ddouwsma@redhat.com>

Looks fine.
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>

> ---
>  repair/progress.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/repair/progress.c b/repair/progress.c
> index f6c4d988..9fb6e3eb 100644
> --- a/repair/progress.c
> +++ b/repair/progress.c
> @@ -501,6 +501,8 @@ duration(int length, char *buf)
>  			strcat(buf, _(", "));
>  		strcat(buf, temp);
>  	}
> +	if (!(weeks|days|hours|minutes|seconds))
> +		sprintf(buf, _("0 seconds"));
>  
>  	return(buf);
>  }
> -- 
> 2.39.3
> 


      parent reply	other threads:[~2023-06-09 15:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31  6:40 [PATCH 0/2] xfstests/xfsprogs xfs_repair progress reporting test Donald Douwsma
2023-05-31  6:40 ` [PATCH v4] xfstests: add test for xfs_repair progress reporting Donald Douwsma
2023-06-09  1:50   ` Murphy Zhou
2023-06-09  3:36     ` Zorro Lang
2023-06-09 14:52   ` Darrick J. Wong
2023-06-10  6:38     ` Zorro Lang
2023-06-15  2:15       ` Donald Douwsma
2023-05-31  6:41 ` [PATCH] xfs_repair: always print an estimate when reporting progress Donald Douwsma
2023-06-09 14:48   ` Darrick J. Wong
2023-06-09 15:03   ` Bill O'Donnell [this message]

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=ZIM/KegChkoeTJE8@redhat.com \
    --to=billodo@redhat.com \
    --cc=ddouwsma@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox