From patchwork Fri Dec 16 15:56:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 9486843 X-Mozilla-Keys: nonjunk Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on sandeen.net X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.0 X-Spam-HP: BAYES_00=-1.9,HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5,RP_MATCHES_RCVD=-0.1 X-Original-To: sandeen@sandeen.net Delivered-To: sandeen@sandeen.net Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by sandeen.net (Postfix) with ESMTP id 5C71092 for ; Fri, 16 Dec 2016 09:56:38 -0600 (CST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761955AbcLPP4l (ORCPT ); Fri, 16 Dec 2016 10:56:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53026 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761614AbcLPP4k (ORCPT ); Fri, 16 Dec 2016 10:56:40 -0500 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 1FFB03F217 for ; Fri, 16 Dec 2016 15:56:20 +0000 (UTC) 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 uBGFuJWW022928 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 16 Dec 2016 10:56:19 -0500 To: linux-xfs From: Eric Sandeen Subject: [PATCH] xfs_repair: don't indicate dirtiness if FSGEOMETRY fails Message-ID: Date: Fri, 16 Dec 2016 09:56:19 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 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.30]); Fri, 16 Dec 2016 15:56:20 +0000 (UTC) Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Today, pointing repair at an image hosted on a non-xfs filesystem will result in a XFS_IOC_FSGEOMETRY_V1 failure, but repair generally proceeds without further problems. However, calling do_warn() sets fs_is_dirty to 1, so xfs_repair -n exits with non-zero status, indicating corruption. This is incorrect. Change the message to use do_log so that it does not incorrectly indicate corruption. Signed-off-by: Eric Sandeen --- -- 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/xfs_repair.c b/repair/xfs_repair.c index d950a32..5c79fd9 100644 --- a/repair/xfs_repair.c +++ b/repair/xfs_repair.c @@ -696,7 +696,7 @@ main(int argc, char **argv) struct xfs_fsop_geom_v1 geom = { 0 }; if (ioctl(fd, XFS_IOC_FSGEOMETRY_V1, &geom) < 0) { - do_warn(_("Cannot get host filesystem geometry.\n" + do_log(_("Cannot get host filesystem geometry.\n" "Repair may fail if there is a sector size mismatch between\n" "the image and the host filesystem.\n")); geom.sectsize = BBSIZE;