From patchwork Fri Aug 5 14:19:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 1038752 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p75ELGiT006133 for ; Fri, 5 Aug 2011 14:21:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756745Ab1HEOVI (ORCPT ); Fri, 5 Aug 2011 10:21:08 -0400 Received: from mail-pz0-f42.google.com ([209.85.210.42]:54164 "EHLO mail-pz0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753237Ab1HEOVF (ORCPT ); Fri, 5 Aug 2011 10:21:05 -0400 Received: by pzk37 with SMTP id 37so3971142pzk.1 for ; Fri, 05 Aug 2011 07:21:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=p+ESXmg8Zz+9wXWnhbzvJya36B+MwVr/wH4Gv2gRwG4=; b=kLZ+QBRIPRA4Np5UQDWBlc4EMzyON/Tb2k1EKs5jprHC/8xZyeBgElTfFBYEVwuJox P74OsDZtZHhLtCTpncWJDeCTcC1VO9gupYdPh3otfICTXEGwjfDSGtNBXAnA/5YXbGxJ ABRT7o8jtbjbnl8x7aYBMsro959MSwumpM11Y= Received: by 10.142.136.10 with SMTP id j10mr1368315wfd.448.1312554065405; Fri, 05 Aug 2011 07:21:05 -0700 (PDT) Received: from shale.localdomain ([41.139.221.94]) by mx.google.com with ESMTPS id s7sm258672pbj.5.2011.08.05.07.21.01 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 05 Aug 2011 07:21:04 -0700 (PDT) Date: Fri, 5 Aug 2011 17:19:00 +0300 From: Dan Carpenter To: Chris Mason Cc: "open list:BTRFS FILE SYSTEM" , kernel-janitors@vger.kernel.org Subject: [patch] btrfs: memory leak in btrfs_add_inode_defrag() Message-ID: <20110805141900.GL7659@shale.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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.6 (demeter1.kernel.org [140.211.167.41]); Fri, 05 Aug 2011 14:21:16 +0000 (UTC) We don't use the defrag struct on this path. Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 658d669..1102059 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -150,6 +150,8 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, spin_lock(&root->fs_info->defrag_inodes_lock); if (!BTRFS_I(inode)->in_defrag) __btrfs_add_inode_defrag(inode, defrag); + else + kfree(defrag); spin_unlock(&root->fs_info->defrag_inodes_lock); return 0; }