From patchwork Wed Feb 28 03:41:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 10246653 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1159560365 for ; Wed, 28 Feb 2018 03:52:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0339328CC7 for ; Wed, 28 Feb 2018 03:52:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC07228CCF; Wed, 28 Feb 2018 03:51:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E5B028CC7 for ; Wed, 28 Feb 2018 03:51:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751631AbeB1Dv6 (ORCPT ); Tue, 27 Feb 2018 22:51:58 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:42293 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751566AbeB1Dv5 (ORCPT ); Tue, 27 Feb 2018 22:51:57 -0500 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="37318680" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 28 Feb 2018 11:51:56 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 0A85448AE763; Wed, 28 Feb 2018 11:51:57 +0800 (CST) Received: from RHEL7.5Alpha (10.167.220.103) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 28 Feb 2018 11:51:55 +0800 From: Xiao Yang To: CC: , , Xiao Yang Subject: [PATCH v2] xfs_repair: Add missing braces Date: Wed, 28 Feb 2018 11:41:53 +0800 Message-ID: <1519789313-4037-1-git-send-email-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.167.220.103] X-yoursite-MailScanner-ID: 0A85448AE763.A7191 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@cn.fujitsu.com Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Eric Sandeen --- 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(