From patchwork Wed Jan 15 12:00:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miao Xie X-Patchwork-Id: 3491421 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9527F9F2E9 for ; Wed, 15 Jan 2014 11:59:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C7A812017E for ; Wed, 15 Jan 2014 11:59:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 029BF2017D for ; Wed, 15 Jan 2014 11:59:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751648AbaAOL7l (ORCPT ); Wed, 15 Jan 2014 06:59:41 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:51858 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751499AbaAOL7j (ORCPT ); Wed, 15 Jan 2014 06:59:39 -0500 X-IronPort-AV: E=Sophos;i="4.95,662,1384272000"; d="scan'208";a="9419835" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 15 Jan 2014 19:55:50 +0800 Received: from fnstmail02.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 s0FBxTuP003394 for ; Wed, 15 Jan 2014 19:59:29 +0800 Received: from miao.fnst.cn.fujitsu.com ([10.167.226.106]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2014011519581565-1106175 ; Wed, 15 Jan 2014 19:58:15 +0800 From: Miao Xie To: linux-btrfs@vger.kernel.org Subject: [PATCH 4/5] Btrfs: fix wrong block group in trace during the free space allocation Date: Wed, 15 Jan 2014 20:00:57 +0800 Message-Id: <1389787258-10865-4-git-send-email-miaox@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1389787258-10865-1-git-send-email-miaox@cn.fujitsu.com> References: <1389787258-10865-1-git-send-email-miaox@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2014/01/15 19:58:15, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2014/01/15 19:58:16, Serialize complete at 2014/01/15 19:58:16 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 We allocate the free space from the former block group, not the current one, so should use the former one to output the trace information. Signed-off-by: Miao Xie --- fs/btrfs/extent-tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a47efc1..3664cfb 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -6345,7 +6345,8 @@ have_block_group: /* we have a block, we're done */ spin_unlock(&last_ptr->refill_lock); trace_btrfs_reserve_extent_cluster(root, - block_group, search_start, num_bytes); + used_block_group, + search_start, num_bytes); if (used_block_group != block_group) { btrfs_put_block_group(block_group); block_group = used_block_group;