All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs_repair: exit with status 2 if log dirtiness is unknown
@ 2016-09-12 12:46 Eric Sandeen
  2016-09-12 13:55 ` Zorro Lang
  2016-09-13 16:01 ` Zorro Lang
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Sandeen @ 2016-09-12 12:46 UTC (permalink / raw)
  To: xfs-oss, linux-xfs

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@redhat.com>
---

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);
 	} else {
 		if (verbose) {
 			do_warn(

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfs_repair: exit with status 2 if log dirtiness is unknown
  2016-09-12 12:46 [PATCH] xfs_repair: exit with status 2 if log dirtiness is unknown Eric Sandeen
@ 2016-09-12 13:55 ` Zorro Lang
  2016-09-13 16:01 ` Zorro Lang
  1 sibling, 0 replies; 3+ messages in thread
From: Zorro Lang @ 2016-09-12 13:55 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs, xfs-oss

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@redhat.com>
> ---
> 
> 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);

HaHa, I've talked about this problem with "Xiao Yang" in:
http://www.spinics.net/lists/fstests/msg03888.html

I talked him either change the _repair_scratch_fs function to check return
status 1, or change xfs_repair to make it return status 2. I don't know if
it's necessary to change the xfs_repair exit status. Is there some rules to
document that?

I'm trying to change the xfs_repair manpage:
http://www.spinics.net/lists/xfs/msg42346.html

Would you please help to check that? Any suggestions about that? I need to
change my patch if this patch will be merged.

Thanks,
Zorro

>  	} else {
>  		if (verbose) {
>  			do_warn(
> 
> --
> 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

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfs_repair: exit with status 2 if log dirtiness is unknown
  2016-09-12 12:46 [PATCH] xfs_repair: exit with status 2 if log dirtiness is unknown Eric Sandeen
  2016-09-12 13:55 ` Zorro Lang
@ 2016-09-13 16:01 ` Zorro Lang
  1 sibling, 0 replies; 3+ messages in thread
From: Zorro Lang @ 2016-09-13 16:01 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs, xfs-oss

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@redhat.com>
> ---
> 
> 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@redhat.com>


>  	} else {
>  		if (verbose) {
>  			do_warn(
> 
> --
> 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

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-13 16:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-12 12:46 [PATCH] xfs_repair: exit with status 2 if log dirtiness is unknown Eric Sandeen
2016-09-12 13:55 ` Zorro Lang
2016-09-13 16:01 ` Zorro Lang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.