From patchwork Fri Jul 1 16:36:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zorro Lang X-Patchwork-Id: 9210203 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 3996A607D6 for ; Fri, 1 Jul 2016 16:36:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A9C928531 for ; Fri, 1 Jul 2016 16:36:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1EEBD286A5; Fri, 1 Jul 2016 16:36:22 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from oss.sgi.com (oss.sgi.com [192.48.182.195]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9273A28531 for ; Fri, 1 Jul 2016 16:36:20 +0000 (UTC) Received: from oss.sgi.com (localhost [IPv6:::1]) by oss.sgi.com (Postfix) with ESMTP id 4774F7CA4; Fri, 1 Jul 2016 11:36:19 -0500 (CDT) X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (Postfix) with ESMTP id A71D07CA3 for ; Fri, 1 Jul 2016 11:36:16 -0500 (CDT) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay3.corp.sgi.com (Postfix) with ESMTP id 31DD7AC002 for ; Fri, 1 Jul 2016 09:36:13 -0700 (PDT) X-ASG-Debug-ID: 1467390972-04bdf074b6286940001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id HYHDPFHHUeaVu8DY (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 01 Jul 2016 09:36:12 -0700 (PDT) X-Barracuda-Envelope-From: zlang@redhat.com X-Barracuda-Effective-Source-IP: mx1.redhat.com[209.132.183.28] X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EED6213A525 for ; Fri, 1 Jul 2016 16:36:11 +0000 (UTC) Received: from localhost (vpn1-4-26.pek2.redhat.com [10.72.4.26]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u61GaAlT012576; Fri, 1 Jul 2016 12:36:11 -0400 From: Zorro Lang To: xfs@oss.sgi.com Subject: [PATCH] xfs_repair: don't mark the fs dirty just because memory possibly be low Date: Sat, 2 Jul 2016 00:36:08 +0800 X-ASG-Orig-Subj: [PATCH] xfs_repair: don't mark the fs dirty just because memory possibly be low Message-Id: <1467390968-1422-1-git-send-email-zlang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 01 Jul 2016 16:36:11 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1467390972 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 1679 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Cc: sandeen@redhat.com, Zorro Lang X-BeenThere: xfs@oss.sgi.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com X-Virus-Scanned: ClamAV using ClamSMTP When I run "xfs_repair -n" on a 500T device with 16G memory, xfs_repair print warning as below: Memory available for repair (11798MB) may not be sufficient. At least 64048MB is needed to repair this filesystem efficiently If repair fails due to lack of memory, please turn prefetching off (-P) to reduce the memory footprint. And it return 1 at last. But xfs_repair didn't hit any error, it just feel the memory maybe too low(not real), then return error. There is no reason to mark the fs dirty just because it thinks it might *possibly* be low on memory. do_warn() will set fs_is_dirty=1, if we only want to print warning message(not real failure), turn to use do_log() will be better. Signed-off-by: Zorro Lang Reviewed-by: Eric Sandeen --- repair/xfs_repair.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c index 9d91f2d..bbf0edc 100644 --- a/repair/xfs_repair.c +++ b/repair/xfs_repair.c @@ -851,16 +851,16 @@ main(int argc, char **argv) "with the -m option. Please increase it to at least %lu.\n"), mem_used / 1024); } - do_warn( + do_log( _("Memory available for repair (%luMB) may not be sufficient.\n" "At least %luMB is needed to repair this filesystem efficiently\n" "If repair fails due to lack of memory, please\n"), max_mem / 1024, mem_used / 1024); if (do_prefetch) - do_warn( + do_log( _("turn prefetching off (-P) to reduce the memory footprint.\n")); else - do_warn( + do_log( _("increase system RAM and/or swap space to at least %luMB.\n"), mem_used * 2 / 1024);