From patchwork Fri Apr 15 22:36:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Bruce Fields" X-Patchwork-Id: 711731 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 p3FMaXqS020835 for ; Fri, 15 Apr 2011 22:36:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751718Ab1DOWgX (ORCPT ); Fri, 15 Apr 2011 18:36:23 -0400 Received: from fieldses.org ([174.143.236.118]:49322 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751472Ab1DOWgX (ORCPT ); Fri, 15 Apr 2011 18:36:23 -0400 Received: from bfields by fieldses.org with local (Exim 4.72) (envelope-from ) id 1QArck-0003W3-1R; Fri, 15 Apr 2011 18:36:22 -0400 Date: Fri, 15 Apr 2011 18:36:21 -0400 From: "J. Bruce Fields" To: Gerhard Heift Cc: linux-nfs@vger.kernel.org Subject: Re: nfsdv4 leaks file descriptors Message-ID: <20110415223621.GB12254@fieldses.org> References: <20110412140148.GA17242@gheift> <20110413211211.GA25189@fieldses.org> <20110414054844.GF17242@gheift> <20110414191005.GB1721@fieldses.org> <20110415132025.GA6126@gheift> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110415132025.GA6126@gheift> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@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, 15 Apr 2011 22:36:34 +0000 (UTC) On Fri, Apr 15, 2011 at 03:20:30PM +0200, Gerhard Heift wrote: > On Thu, Apr 14, 2011 at 03:10:06PM -0400, J. Bruce Fields wrote: > > On Thu, Apr 14, 2011 at 07:48:45AM +0200, Gerhard Heift wrote: > > > On Wed, Apr 13, 2011 at 05:12:11PM -0400, J. Bruce Fields wrote: > > > > On Tue, Apr 12, 2011 at 04:01:50PM +0200, Gerhard Heift wrote: > > > > > Hello, > > > > > > > > > > I have a linux kernel (2.6.38.2, armv5tel) running which exports a > > > > > directory with following options: > > > > > > > > Should be fixed in more recent stable kernel; let me know if not. > > > > > > An even more recent stable than 2.6.38.2? I just compiled 2.6.39-rc3 and > > > there the leak happens too. > > > > Ugh. OK, investigating. > > It took me a bit of time, but I located the commit which introduced this > behavior: acfdf5c383b38f7f4dddae41b97c97f1ae058f49 Doh--probably we just need this (lightly tested). Thanks for tracking this down. --b. commit 21cd8aaf5efb086361cf12f9245c14a3b19fbafd Author: J. Bruce Fields Date: Fri Apr 15 18:08:26 2011 -0400 nfsd4: fix struct file leak on delegation Introduced by acfdf5c383b38f7f4dddae41b97c97f1ae058f49. Reported-by: Gerhard Heift Signed-off-by: J. Bruce Fields --- To unsubscribe from this list: send the line "unsubscribe linux-nfs" 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/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index aa309aa..c79a983 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -258,6 +258,7 @@ static void nfs4_put_deleg_lease(struct nfs4_file *fp) if (atomic_dec_and_test(&fp->fi_delegees)) { vfs_setlease(fp->fi_deleg_file, F_UNLCK, &fp->fi_lease); fp->fi_lease = NULL; + fput(fp->fi_deleg_file); fp->fi_deleg_file = NULL; } }