From mboxrd@z Thu Jan 1 00:00:00 1970 From: "J. Bruce Fields" Subject: Re: Leak in nlmsvc_testlock for async GETFL case Date: Mon, 14 Jan 2008 15:44:19 -0500 Message-ID: <20080114204419.GD16926@fieldses.org> References: <48611B2F-1587-48C5-9F30-8DCFA1121CF6@Sun.COM> <20071129190848.GA17907@fieldses.org> <71BCABE5-52AD-4573-8DC0-5C57152A397B@Sun.COM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Oleg Drokin Return-path: Received: from mail.fieldses.org ([66.93.2.214]:59496 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750702AbYANUo0 (ORCPT ); Mon, 14 Jan 2008 15:44:26 -0500 Content-Disposition: inline In-Reply-To: <71BCABE5-52AD-4573-8DC0-5C57152A397B@Sun.COM> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Jan 11, 2008 at 09:57:35PM -0500, Oleg Drokin wrote: > Hello! > > On Nov 29, 2007, at 2:08 PM, J. Bruce Fields wrote: > >> On Thu, Nov 29, 2007 at 01:46:04PM -0500, Oleg Drokin wrote: >>> Hello! >>> >>> Per our discussion, I am resending this patch that fixes a leak in >>> nlmsvc_testlock. It is addition to another leak fixing patch you >>> already have. Without the patch, there is a leakage of nlmblock >>> structure refcount that holds a reference nlmfile structure, that >>> holds a reference to struct file, when async GETFL is used >>> (-EINPROGRESS return from file_ops->lock()), and also in some error >>> cases >> Thanks for the fix! Looks right to me. Yes, somehow I missed this >> one >> when you sent it privately. Applied and pushed out to >> git://linux-nfs.org/~bfields/linux.git nfs-server-stable >> and I'll submit it for 2.6.25. > > After playing around that code a bit more, I figured out the leak was > not > completely fixed by that first patch, the case where there is > conflicting > lock passed in by callback still leaks block reference. > This simple incremental fix (against your current tree) takes care of > that. > > Signed-off-by: Oleg Drokin Thanks! I've queued it up for 2.6.25. --b.