From patchwork Wed Mar 15 18:32:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 9626409 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 11C316048C for ; Wed, 15 Mar 2017 18:34:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08E6F28601 for ; Wed, 15 Mar 2017 18:34:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1FBB2861F; Wed, 15 Mar 2017 18:34:33 +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 ABC5E28601 for ; Wed, 15 Mar 2017 18:34:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751917AbdCOSeP (ORCPT ); Wed, 15 Mar 2017 14:34:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43740 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751102AbdCOScl (ORCPT ); Wed, 15 Mar 2017 14:32:41 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (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 481C99D4E9 for ; Wed, 15 Mar 2017 18:32:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 481C99D4E9 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=sandeen@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 481C99D4E9 Received: from [IPv6:::1] (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2FIWZPO022288 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 15 Mar 2017 14:32:36 -0400 To: linux-xfs From: Eric Sandeen Subject: [PATCH] xfs_repair: warn about dirty log with -n option Message-ID: Date: Wed, 15 Mar 2017 13:32:34 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 15 Mar 2017 18:32:36 +0000 (UTC) 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 looking at xfs_repair -n output today, we have no idea if reported errors may be due to an un-replayed dirty log. If this is the case, mention it in the output. Signed-off-by: Eric Sandeen Reviewed-by: Darrick J. Wong --- pls check double-check my logic for the 3 cases :) -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/repair/phase2.c b/repair/phase2.c index 5964244..c21778b 100644 --- a/repair/phase2.c +++ b/repair/phase2.c @@ -90,11 +90,16 @@ zero_log( _("zero_log: head block %" PRId64 " tail block %" PRId64 "\n"), head_blk, tail_blk); } - if (!no_modify && head_blk != tail_blk) { - if (zap_log) { + if (head_blk != tail_blk) { + if (!no_modify && zap_log) { do_warn(_( "ALERT: The filesystem has valuable metadata changes in a log which is being\n" "destroyed because the -L option was used.\n")); + } else if (no_modify) { + do_warn(_( +"ALERT: The filesystem has valuable metadata changes in a log which is being\n" +"ignored because the -n option was used. Expect spurious inconsistencies\n" +"which may be resolved by first mounting the filesystem to replay the log.\n")); } else { do_warn(_( "ERROR: The filesystem has valuable metadata changes in a log which needs to\n"