From patchwork Mon May 17 17:15:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sage Weil X-Patchwork-Id: 100161 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 o4HHFYgZ016998 for ; Mon, 17 May 2010 17:15:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752090Ab0EQRPc (ORCPT ); Mon, 17 May 2010 13:15:32 -0400 Received: from cobra.newdream.net ([66.33.216.30]:33676 "EHLO cobra.newdream.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751560Ab0EQRPb (ORCPT ); Mon, 17 May 2010 13:15:31 -0400 Received: from localhost.localdomain (ip-66-33-206-8.dreamhost.com [66.33.206.8]) by cobra.newdream.net (Postfix) with ESMTPA id 1EE83BC776; Mon, 17 May 2010 10:18:49 -0700 (PDT) From: Sage Weil To: linux-btrfs@vger.kernel.org Cc: Sage Weil Subject: [PATCH] Btrfs: avoid BUG when dropping root and reference in same transaction Date: Mon, 17 May 2010 10:15:27 -0700 Message-Id: <1274116527-12361-1-git-send-email-sage@newdream.net> X-Mailer: git-send-email 1.6.6.1 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, 17 May 2010 17:15:34 +0000 (UTC) diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c index 67fa2d2..7cb5041 100644 --- a/fs/btrfs/root-tree.c +++ b/fs/btrfs/root-tree.c @@ -313,7 +313,6 @@ int btrfs_del_root(struct btrfs_trans_handle *trans, struct btrfs_root *root, { struct btrfs_path *path; int ret; - u32 refs; struct btrfs_root_item *ri; struct extent_buffer *leaf; @@ -327,8 +326,6 @@ int btrfs_del_root(struct btrfs_trans_handle *trans, struct btrfs_root *root, leaf = path->nodes[0]; ri = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_root_item); - refs = btrfs_disk_root_refs(leaf, ri); - BUG_ON(refs != 0); ret = btrfs_del_item(trans, root, path); out: btrfs_free_path(path);