linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: sandeen@sandeen.net
Cc: darrick.wong@oracle.com, linux-xfs@vger.kernel.org,
	Xiao Yang <yangx.jy@cn.fujitsu.com>
Subject: [PATCH v2] xfs_repair: Add missing braces
Date: Wed, 28 Feb 2018 11:41:53 +0800	[thread overview]
Message-ID: <1519789313-4037-1-git-send-email-yangx.jy@cn.fujitsu.com> (raw)
In-Reply-To: <b311ddb9-e996-9e4b-f7f1-d0d45b8f782a@sandeen.net>

When xlog_find_tail() fails to find the head or the tail, the missing
braces leads that an unparseable log always exits with status 2, even
if we've asked for -n or -L which should proceed.  We can expose this
issue by xfstests case xfs/098.

Fixes:'commit b04647edea32 ("xfs_repair: exit with status 2 if log dirtiness is unknown")'

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 repair/phase2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/repair/phase2.c b/repair/phase2.c
index 992e997..c124882 100644
--- a/repair/phase2.c
+++ b/repair/phase2.c
@@ -78,12 +78,13 @@ zero_log(
 		do_warn(
 		_("zero_log: cannot find log head/tail (xlog_find_tail=%d)\n"),
 			error);
-		if (!no_modify && !zap_log)
+		if (!no_modify && !zap_log) {
 			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_log(
-- 
1.8.3.1




  parent reply	other threads:[~2018-02-28  3:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-27  5:50 [PATCH] xfs_repair: Ensure just xfs_repair without -n can return a status code of 2 Xiao Yang
2018-02-27 14:21 ` Eric Sandeen
2018-02-28  1:32   ` Xiao Yang
2018-02-28  3:41   ` Xiao Yang [this message]
2018-02-28  3:57     ` [PATCH v2] xfs_repair: Add missing braces Eric Sandeen

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=1519789313-4037-1-git-send-email-yangx.jy@cn.fujitsu.com \
    --to=yangx.jy@cn.fujitsu.com \
    --cc=darrick.wong@oracle.com \
    --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).