From patchwork Mon Dec 9 16:14:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Shilong X-Patchwork-Id: 3311691 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 285E9C0D4A for ; Mon, 9 Dec 2013 16:15:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1C8CF2013D for ; Mon, 9 Dec 2013 16:15:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BC7BF202EA for ; Mon, 9 Dec 2013 16:15:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933967Ab3LIQPL (ORCPT ); Mon, 9 Dec 2013 11:15:11 -0500 Received: from mail-pb0-f47.google.com ([209.85.160.47]:50756 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933943Ab3LIQOi (ORCPT ); Mon, 9 Dec 2013 11:14:38 -0500 Received: by mail-pb0-f47.google.com with SMTP id um1so5719269pbc.20 for ; Mon, 09 Dec 2013 08:14:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=JYPOpHaFvk6U5cgeg7YVWuY+O7KSShFmJAO22XXksYY=; b=way4J/KLmoSt9FfcmfS0NYB/KGhAal3D636hXD28AIv1hcykBTonIFVqQvQYKUw0UK /ydTzaRbHqs8IozWioQeMagOL/2+MbybUXlYcIrlSCJI8zHl0fScmMbI6IgjFwX8BMiD k7DS+awZdCYmUQ1l+ExUKCrCUOoJP6H2gcSzR/CouHGvcl2UkBxYEzQIzk2pCkXM5bQt NXM+pRRYbBpduoX2GfHZ7dtrmLhh6SoQbOtGrXuki3rkw4gVcMaXFxtF4V5OAevA3Z9b w/GyJjJVXaXh2I7njX1eYEnG76pbT2OC79PclNA49rYI0SBbEkqVh1r51ffkvNjuSzbj F39Q== X-Received: by 10.68.197.73 with SMTP id is9mr21723574pbc.75.1386605677767; Mon, 09 Dec 2013 08:14:37 -0800 (PST) Received: from linux-b0ol.localdomain ([223.65.188.80]) by mx.google.com with ESMTPSA id ql10sm19065866pbc.44.2013.12.09.08.14.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Dec 2013 08:14:37 -0800 (PST) From: Wang Shilong To: linux-btrfs@vger.kernel.org Cc: wangsl.fnst@cn.fujitsu.com Subject: [PATCH 1/2] Btrfs: fix an oops when doing balance relocation Date: Tue, 10 Dec 2013 00:14:33 +0800 Message-Id: <1386605674-3320-1-git-send-email-wangshilong1991@gmail.com> X-Mailer: git-send-email 1.8.4 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Wang Shilong I hit a BUG_ON() when inserting reloc root into rc->reloc_root_tree.rb_root, the fact is block bytenr has been inserted before, this is really a redicious bug, the reason is that we freed root node after we have allocated root node block,and this block bytenr will be reused and then oops happens. Signed-off-by: Wang Shilong --- fs/btrfs/relocation.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index ce459a7..4dc7f26 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -1361,7 +1361,6 @@ static struct btrfs_root *create_reloc_root(struct btrfs_trans_handle *trans, } btrfs_tree_unlock(eb); - free_extent_buffer(eb); ret = btrfs_insert_root(trans, root->fs_info->tree_root, &root_key, root_item);