Return-Path: Received: from mx2.netapp.com ([216.240.18.37]:48914 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751335Ab0LAXVe convert rfc822-to-8bit (ORCPT ); Wed, 1 Dec 2010 18:21:34 -0500 Subject: Re: [PATCH v2 3/3] NFS: Fix a memory leak in nfs_readdir From: Trond Myklebust To: Andrew Morton Cc: Linus Torvalds , Hugh Dickins , Nick Piggin , Nick Bowler , Linux Kernel Mailing List , linux-nfs@vger.kernel.org, Rik van Riel , Christoph Hellwig , Al Viro In-Reply-To: <1291243633.6609.59.camel@heimdal.trondhjem.org> References: <1291217804-11257-1-git-send-email-Trond.Myklebust@netapp.com> <1291217804-11257-2-git-send-email-Trond.Myklebust@netapp.com> <20101201150428.GA2879@elliptictech.com> <1291217804-11257-3-git-send-email-Trond.Myklebust@netapp.com> <1291217804-11257-4-git-send-email-Trond.Myklebust@netapp.com> <1291229669.6609.24.camel@heimdal.trondhjem.org> <1291234251.6609.39.camel@heimdal.trondhjem.org> <20101201123341.d12ef362.akpm@linux-foundation.org> <20101201133831.ea6ba10a.akpm@linux-foundation.org> <1291240272.6609.50.camel@heimdal.trondhjem.org> <20101201141351.8609140b.akpm@linux-foundation.org> <20101201143856.51f4f9d9.akpm@linux-foundation.org> <1291243633.6609.59.camel@heimdal.trondhjem.org> Content-Type: text/plain; charset="UTF-8" Date: Wed, 01 Dec 2010 18:21:16 -0500 Message-ID: <1291245676.6609.62.camel@heimdal.trondhjem.org> Sender: linux-nfs-owner@vger.kernel.org List-ID: MIME-Version: 1.0 On Wed, 2010-12-01 at 17:47 -0500, Trond Myklebust wrote: > However, Linus' explanation appears to answer one of Hugh's objections: > we can apparently use a preempt-disable() in order to ensure that the > module containing the mapping->a_ops is not unloaded until after the > ->freepage() call is complete. > > That would imply that ->freepage() cannot sleep, but I don't think that > is too nasty a restriction. Revised patch would be as follows... ----------------------------------------------------------------------------------------