From patchwork Mon May 31 09:04:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 103235 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4V96Bm4014011 for ; Mon, 31 May 2010 09:06:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754883Ab0EaJGJ (ORCPT ); Mon, 31 May 2010 05:06:09 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]:53460 "EHLO rcsinet10.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751437Ab0EaJGI (ORCPT ); Mon, 31 May 2010 05:06:08 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o4V965tK030494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 31 May 2010 09:06:07 GMT Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o4V5YfSO016867 for ; Mon, 31 May 2010 09:06:04 GMT Received: from abhmt003.oracle.com by acsmt353.oracle.com with ESMTP id 310241071275296700; Mon, 31 May 2010 02:05:00 -0700 Received: from [192.168.0.100] (/125.71.157.77) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 31 May 2010 02:04:59 -0700 Message-ID: <4C037BAE.9010300@oracle.com> Date: Mon, 31 May 2010 17:04:46 +0800 From: "Yan, Zheng" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-2.fc12 Thunderbird/3.0.4 MIME-Version: 1.0 To: linux-btrfs@vger.kernel.org CC: Chris Mason Subject: [PATCH] btrfs: Fix BUG_ON for fs converted from extN X-Auth-Type: Internal IP X-Source-IP: acsinet15.oracle.com [141.146.126.227] X-CT-RefId: str=0001.0A090201.4C037BFF.0190:SCFMA922111,ss=1,fgs=0 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]); Mon, 31 May 2010 09:06:12 +0000 (UTC) diff -urp 1/fs/btrfs/extent-tree.c 3/fs/btrfs/extent-tree.c --- 1/fs/btrfs/extent-tree.c 2010-05-26 23:55:46.610378078 +0800 +++ 3/fs/btrfs/extent-tree.c 2010-05-31 16:36:51.907580723 +0800 @@ -4360,7 +4360,8 @@ void btrfs_free_tree_block(struct btrfs_ block_rsv = get_block_rsv(trans, root); cache = btrfs_lookup_block_group(root->fs_info, buf->start); - BUG_ON(block_rsv->space_info != cache->space_info); + if (block_rsv->space_info != cache->space_info) + goto out; if (btrfs_header_generation(buf) == trans->transid) { if (root->root_key.objectid != BTRFS_TREE_LOG_OBJECTID) {