aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiao Yang <yangx.jy@cn.fujitsu.com>2018-03-08 20:35:20 -0600
committerEric Sandeen <sandeen@redhat.com>2018-03-08 20:35:20 -0600
commita2e81058c167b6b9761b46883cdd6371616a2de6 (patch)
tree6d0d53b08341375721832d1af1da945b93ceab0b
parent57e7138aa513b89813d042a5410d335baf39a009 (diff)
downloadxfsprogs-dev-a2e81058c167b6b9761b46883cdd6371616a2de6.tar.gz
xfs_repair: Add missing braces to allow zeroing of corrupt log
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> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r--repair/phase2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/repair/phase2.c b/repair/phase2.c
index 992e997b03..c124882627 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(