From patchwork Mon Oct 8 19:07:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dieter Ries X-Patchwork-Id: 1566721 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 427B74025F for ; Mon, 8 Oct 2012 19:08:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754696Ab2JHTIO (ORCPT ); Mon, 8 Oct 2012 15:08:14 -0400 Received: from psi.thgersdorf.net ([176.9.98.78]:57775 "EHLO mail.psioc.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754595Ab2JHTIK (ORCPT ); Mon, 8 Oct 2012 15:08:10 -0400 Received: from localhost (localhost [127.0.0.1]) by localhost.psioc.net (Postfix) with ESMTP id CDB764D64C5; Mon, 8 Oct 2012 21:08:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at psioc.net Received: from mail.psioc.net ([127.0.0.1]) by localhost (mail.psioc.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id OH7t-Jkzr1Um; Mon, 8 Oct 2012 21:08:08 +0200 (CEST) Received: from psioc.net (unknown [195.176.92.20]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mail.psioc.net (Postfix) with ESMTPSA id 546C54D651D; Mon, 8 Oct 2012 21:08:08 +0200 (CEST) From: Dieter Ries To: chris.mason@fusionio.com, linux-btrfs@vger.kernel.org Cc: Dieter Ries Subject: [PATCH 4/4] btrfs-progs: btrfsck: Remove binary error code output Date: Mon, 8 Oct 2012 21:07:50 +0200 Message-Id: <1349723270-12773-5-git-send-email-mail@dieterries.net> X-Mailer: git-send-email 1.7.3.GIT In-Reply-To: <1349723270-12773-1-git-send-email-mail@dieterries.net> References: <1349723270-12773-1-git-send-email-mail@dieterries.net> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org This patch changes the output after checking a filesystem. Before, the default output was "found x bytes used err is 0", where the last integer corresponds to the return value of check_root_refs(), which is either 1 or 0. Now this value is evaluated, and a message saying if errors were found or not is printed. Signed-off-by: Dieter Ries --- btrfsck.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/btrfsck.c b/btrfsck.c index 83275cd..45ce681 100644 --- a/btrfsck.c +++ b/btrfsck.c @@ -3613,8 +3613,11 @@ out: "backup data and re-format the FS. *\n\n"); ret = 1; } - printf("found %llu bytes used err is %d\n", - (unsigned long long)bytes_used, ret); + if (ret) + printf("Filesystem is damaged! One or more errors found.\n"); + else + printf("Filesystem is clean! No errors found.\n"); + printf("%llu bytes used\n",(unsigned long long)bytes_used); printf("total csum bytes: %llu\n",(unsigned long long)total_csum_bytes); printf("total tree bytes: %llu\n", (unsigned long long)total_btree_bytes);