From patchwork Fri Feb 23 12:00:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yangerkun X-Patchwork-Id: 10237485 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 D7434602A0 for ; Fri, 23 Feb 2018 11:51:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C58FC2953E for ; Fri, 23 Feb 2018 11:51:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B9B5129542; Fri, 23 Feb 2018 11:51:16 +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 0E6E92953E for ; Fri, 23 Feb 2018 11:51:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750903AbeBWLvP (ORCPT ); Fri, 23 Feb 2018 06:51:15 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:5261 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750798AbeBWLvP (ORCPT ); Fri, 23 Feb 2018 06:51:15 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 9F10652D5B0A0; Fri, 23 Feb 2018 19:51:01 +0800 (CST) Received: from 138.huawei.com (10.175.124.28) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.361.1; Fri, 23 Feb 2018 19:50:55 +0800 From: yangerkun To: , CC: , , , , , , Subject: [PATCH] fsck.overlay: fix report bug Date: Fri, 23 Feb 2018 20:00:16 +0800 Message-ID: <20180223120016.32728-1-yangerkun@huawei.com> X-Mailer: git-send-email 2.13.6 MIME-Version: 1.0 X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now, the ovl_scan_check will not show all the infomation about the invalid xattr. Signed-off-by: yangerkun --- check.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/check.c b/check.c index 10d345f..e109620 100644 --- a/check.c +++ b/check.c @@ -904,19 +904,26 @@ static void ovl_scan_report(struct scan_ctx *sctx) /* Report the invalid targets left */ static void ovl_scan_check(struct scan_ctx *sctx) { - if (sctx->i_whiteouts) + bool incons = false; + + if (sctx->i_whiteouts) { print_info(_("Invalid whiteouts %d left!\n"), sctx->i_whiteouts); - else if (sctx->i_redirects) + incons = true; + } + if (sctx->i_redirects) { print_info(_("Invalid redirect directories %d left!\n"), sctx->i_redirects); - else if (sctx->m_impure) + incons = true; + } + if (sctx->m_impure) { print_info(_("Directories %d missing impure xattr!\n"), sctx->m_impure); - else - return; + incons = true; + } - set_inconsistency(&status); + if (incons) + set_inconsistency(&status); } /* Scan upperdir and each lowerdirs, check and fix inconsistency */