From patchwork Tue Jul 13 09:18:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miao Xie X-Patchwork-Id: 111733 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6D9KifS016310 for ; Tue, 13 Jul 2010 09:20:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752231Ab0GMJUm (ORCPT ); Tue, 13 Jul 2010 05:20:42 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:56621 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751421Ab0GMJUl (ORCPT ); Tue, 13 Jul 2010 05:20:41 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 59624170130; Tue, 13 Jul 2010 17:20:39 +0800 (CST) Received: from fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id o6D9HsCo019745; Tue, 13 Jul 2010 17:17:54 +0800 Received: from [10.167.141.211] (unknown [10.167.141.211]) by fnst.cn.fujitsu.com (Postfix) with ESMTPA id D506710C1B9; Tue, 13 Jul 2010 17:20:59 +0800 (CST) Message-ID: <4C3C2F4C.6030402@cn.fujitsu.com> Date: Tue, 13 Jul 2010 17:18:04 +0800 From: Miao Xie Reply-To: miaox@cn.fujitsu.com User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100413 Fedora/3.0.4-2.fc13 Thunderbird/3.0.4 MIME-Version: 1.0 To: Chris Mason CC: Linux Btrfs Subject: [PATCH] btrfs-progs: fix wrong extent buffer size when reading tree block Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 13 Jul 2010 09:20:44 +0000 (UTC) diff --git a/debug-tree.c b/debug-tree.c index 40628e0..cf637ab 100644 --- a/debug-tree.c +++ b/debug-tree.c @@ -208,7 +208,9 @@ again: read_extent_buffer(leaf, &ri, offset, sizeof(ri)); buf = read_tree_block(tree_root_scan, btrfs_root_bytenr(&ri), - tree_root_scan->leafsize, 0); + btrfs_level_size(tree_root_scan, + btrfs_root_level(&ri)), + 0); switch(found_key.objectid) { case BTRFS_ROOT_TREE_OBJECTID: if (!skip)