From patchwork Thu Sep 16 03:23:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liubo X-Patchwork-Id: 184362 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8G3JLX3017094 for ; Thu, 16 Sep 2010 03:19:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752028Ab0IPDTS (ORCPT ); Wed, 15 Sep 2010 23:19:18 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:56636 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751694Ab0IPDTS (ORCPT ); Wed, 15 Sep 2010 23:19:18 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id A967F17018F; Thu, 16 Sep 2010 11:19:12 +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 o8G3Fac2000722; Thu, 16 Sep 2010 11:15:36 +0800 Received: from localhost.localdomain (unknown [10.167.141.170]) by fnst.cn.fujitsu.com (Postfix) with ESMTPA id DBB1E10C21C; Thu, 16 Sep 2010 11:20:49 +0800 (CST) Message-ID: <4C918DC2.7080701@cn.fujitsu.com> Date: Thu, 16 Sep 2010 11:23:46 +0800 From: liubo User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: Linux Btrfs CC: Chris Mason , Josef Bacik , "Yan, Zheng" Subject: [PATCH] Btrfs: fix memory leak on free root 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 (demeter1.kernel.org [140.211.167.41]); Thu, 16 Sep 2010 03:19:21 +0000 (UTC) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 280de15..fe20248 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -2335,6 +2335,7 @@ static int del_fs_roots(struct btrfs_fs_info *fs_info) } else { free_extent_buffer(gang[0]->node); free_extent_buffer(gang[0]->commit_root); + kfree(gang[0]->name); kfree(gang[0]); } } diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index f631910..83c422c 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -6019,6 +6019,7 @@ int btrfs_drop_snapshot(struct btrfs_root *root, } else { free_extent_buffer(root->node); free_extent_buffer(root->commit_root); + kfree(root->name); kfree(root); } out: