From patchwork Fri Sep 21 06:59:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 1489851 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 4FBE53FCFC for ; Fri, 21 Sep 2012 06:57:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755224Ab2IUG5N (ORCPT ); Fri, 21 Sep 2012 02:57:13 -0400 Received: from acsinet15.oracle.com ([141.146.126.227]:51009 "EHLO acsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754943Ab2IUG5M (ORCPT ); Fri, 21 Sep 2012 02:57:12 -0400 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q8L6v9TY023659 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 21 Sep 2012 06:57:10 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q8L6v8H7017903 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 21 Sep 2012 06:57:09 GMT Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q8L6v8PR030364 for ; Fri, 21 Sep 2012 01:57:08 -0500 Received: from localhost.localdomain (/10.186.101.18) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 20 Sep 2012 23:57:08 -0700 From: Anand jain To: linux-btrfs@vger.kernel.org Subject: [PATCH 1/2] Btrfs-progs: fix the btrfs-debug-tree usage Date: Fri, 21 Sep 2012 14:59:44 +0800 Message-Id: <1348210784-29681-1-git-send-email-Anand.Jain@oracle.com> X-Mailer: git-send-email 1.7.7 X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Anand Jain Signed-off-by: Anand Jain --- debug-tree.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/debug-tree.c b/debug-tree.c index 94ffd8e..0e391fc 100644 --- a/debug-tree.c +++ b/debug-tree.c @@ -30,7 +30,7 @@ static int print_usage(void) { - fprintf(stderr, "usage: debug-tree [ -e ] device\n"); + fprintf(stderr, "usage: debug-tree [-derR] [-b ] device\n"); fprintf(stderr, "%s\n", BTRFS_BUILD_VERSION); exit(1); } @@ -51,6 +51,8 @@ static void print_extents(struct btrfs_root *root, struct extent_buffer *eb) btrfs_node_blockptr(eb, i), size, btrfs_node_ptr_generation(eb, i)); + if(!next) + BUG(); if (btrfs_is_leaf(next) && btrfs_header_level(eb) != 1) BUG();