From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from k22.active24.pl ([195.78.67.22]:40284 "EHLO k22.active24.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751480AbcFJOqt (ORCPT ); Fri, 10 Jun 2016 10:46:49 -0400 Subject: Re: freevxfs: hp-ux support. ( 1cce17017970c07) patchset 1/4 From: Krzysztof =?UTF-8?Q?B=C5=82aszkowski?= To: Christoph Hellwig Cc: Carlos Maiolino , linux-fsdevel@vger.kernel.org In-Reply-To: <20160602082518.GB12071@infradead.org> References: <1464273946.17980.15.camel@linux-q3cb.site> <1464464428.3689.14.camel@linux-q3cb.site> <20160531122510.GA25651@infradead.org> <1464702291.900.75.camel@linux-q3cb.site> <20160601073310.GA6787@infradead.org> <1464773012.900.105.camel@linux-q3cb.site> <20160602082518.GB12071@infradead.org> Content-Type: text/plain; charset="UTF-8" Date: Fri, 10 Jun 2016 16:46:43 +0200 Message-ID: <1465570003.5573.22.camel@linux-q3cb.site> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Christoph, Here are these kfree()s. >>From e82e484492af7a66b25510718783529bad345cfc Mon Sep 17 00:00:00 2001 From: KB Date: Fri, 10 Jun 2016 09:52:19 +0200 Subject: [PATCH 1/4] vxfs_read_fshead() memory leak fixed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit every successful mount two structs vxfs_fsh were not released Signed-off-by: Krzysztof Błaszkowski --- fs/freevxfs/vxfs_fshead.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/freevxfs/vxfs_fshead.c b/fs/freevxfs/vxfs_fshead.c index 69a10d6..a4610a7 100644 --- a/fs/freevxfs/vxfs_fshead.c +++ b/fs/freevxfs/vxfs_fshead.c @@ -172,6 +172,8 @@ vxfs_read_fshead(struct super_block *sbp) goto out_iput_ilist; } + kfree(pfp); + kfree(sfp); return 0; out_iput_ilist: -- 2.8.3 On Thu, 2016-06-02 at 01:25 -0700, Christoph Hellwig wrote: > On Wed, Jun 01, 2016 at 11:23:32AM +0200, Krzysztof B??aszkowski wrote: > > I think that there are no "kfree(pfp); kfree(sfp); return 0;" in > > vxfs_read_fshead() still. Are pfp and sfp needed anywhere ? I am sure > > they are not so there is a memory leak without these kfrees every mount. > > > > I am not sure absolutely of that read_fshead() is missing these kfrees > > because I have seen just these diffs, anyway I did not notice "+kfree". > > The frees are still missing. Do you want to send me a patch for those? > > > needles to say that I prefer to have limited scope of visibility of > > inode_cachep to the inode.c only. > > In my tree the visibility is in vxfs_super.c only. Given that the > alloc/destroy methods are super operations that seems to fit better > as they can have local scope, too. > -- > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Krzysztof Blaszkowski