From patchwork Fri Apr 18 23:13:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rakesh Pandit X-Patchwork-Id: 4018921 X-Patchwork-Delegate: dave@jikos.cz Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8B85DBFF02 for ; Fri, 18 Apr 2014 23:14:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AEF1220380 for ; Fri, 18 Apr 2014 23:14:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F08082026C for ; Fri, 18 Apr 2014 23:14:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752798AbaDRXOB (ORCPT ); Fri, 18 Apr 2014 19:14:01 -0400 Received: from nbl-ex10-fe02.nebula.fi ([188.117.32.122]:50673 "EHLO ex10.nebula.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751947AbaDRXN7 (ORCPT ); Fri, 18 Apr 2014 19:13:59 -0400 Received: from hercules.tuxera.com (88.195.159.123) by ex10.nebula.fi (188.117.32.115) with Microsoft SMTP Server (TLS) id 14.3.174.1; Sat, 19 Apr 2014 02:13:56 +0300 Date: Sat, 19 Apr 2014 02:13:55 +0300 From: Rakesh Pandit To: Subject: [PATCH 1/2] Btrfs-progs: fsck: while checking root refs print readable errors Message-ID: <20140418231354.GA1874@hercules.tuxera.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [88.195.159.123] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Lets use "errors" instead of "error" because more then one ref errors are possible. Also print error messages for unresolved refs in check_root_refs. Signed-off-by: Rakesh Pandit --- cmds-check.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmds-check.c b/cmds-check.c index 93f9ae6..6ea8c68 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -1610,7 +1610,7 @@ static int check_inode_recs(struct btrfs_root *root, if (!backref->found_inode_ref) backref->errors |= REF_ERR_NO_INODE_REF; fprintf(stderr, "\tunresolved ref dir %llu index %llu" - " namelen %u name %s filetype %d error %x", + " namelen %u name %s filetype %d errors %x", (unsigned long long)backref->dir, (unsigned long long)backref->index, backref->namelen, backref->name, @@ -1886,12 +1886,13 @@ static int check_root_refs(struct btrfs_root *root, if (!backref->errors && rec->found_root_item) continue; fprintf(stderr, "\tunresolved ref root %llu dir %llu" - " index %llu namelen %u name %s error %x\n", + " index %llu namelen %u name %s errors %x\n", (unsigned long long)backref->ref_root, (unsigned long long)backref->dir, (unsigned long long)backref->index, backref->namelen, backref->name, backref->errors); + print_ref_error(backref->errors); } } return errors > 0 ? 1 : 0;