xfs
[Top] [All Lists]

Re: [PATCH] xfs_repair: exit with status 2 if log dirtiness is unknown

To: Eric Sandeen <sandeen@xxxxxxxxxx>
Subject: Re: [PATCH] xfs_repair: exit with status 2 if log dirtiness is unknown
From: Zorro Lang <zlang@xxxxxxxxxx>
Date: Wed, 14 Sep 2016 00:01:20 +0800
Cc: xfs-oss <xfs@xxxxxxxxxxx>, linux-xfs@xxxxxxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <4c59d0b7-bf53-ca58-1bcf-b95d1c9c44dc@xxxxxxxxxx>
References: <4c59d0b7-bf53-ca58-1bcf-b95d1c9c44dc@xxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Sep 12, 2016 at 07:46:05AM -0500, Eric Sandeen wrote:
> This new case is mostly like the known dirty log case; the log
> is corrupt, dirtiness cannot be determined, and a mount/umount
> cycle or an xfs_repair -L is required.
> 
> So exit with status 2 here as well.
> 
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> ---
> 
> diff --git a/repair/phase2.c b/repair/phase2.c
> index e21ffa6..5964244 100644
> --- a/repair/phase2.c
> +++ b/repair/phase2.c
> @@ -79,10 +79,11 @@ zero_log(
>               _("zero_log: cannot find log head/tail (xlog_find_tail=%d)\n"),
>                       error);
>               if (!no_modify && !zap_log)
> -                     do_error(_(
> +                     do_warn(_(
>  "ERROR: The log head and/or tail cannot be discovered. Attempt to mount 
> the\n"
>  "filesystem to replay the log or use the -L option to destroy the log and\n"
>  "attempt a repair.\n"));
> +                     exit(2);

I think it makes sense for me. Exit 2 means log needs to be replayed or cleared.
If we meet xfs_repair return 2, we can do the same steps to deal with that:
 1. try to mount
 2. If mount fail, try xfs_repair -L

So I agree with this patch:
Reviewed-by: Zorro Lang <zlang@xxxxxxxxxx>


>       } else {
>               if (verbose) {
>                       do_warn(
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

<Prev in Thread] Current Thread [Next in Thread>