[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20101201144314.6a827f8d.akpm@linux-foundation.org>
Date: Wed, 1 Dec 2010 14:43:14 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Neil Brown <neilb@...e.de>
Cc: Trond Myklebust <Trond.Myklebust@...app.com>,
Hugh Dickins <hughd@...gle.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Nick Bowler <nbowler@...iptictech.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-nfs@...r.kernel.org, Rik van Riel <riel@...hat.com>,
Christoph Hellwig <hch@....de>,
Al Viro <viro@...iv.linux.org.uk>,
Nick Piggin <npiggin@...nel.dk>
Subject: Re: [PATCH v2 3/3] NFS: Fix a memory leak in nfs_readdir
On Thu, 2 Dec 2010 08:29:13 +1100
Neil Brown <neilb@...e.de> wrote:
> > >
> > > However, while reading Documentation/filesystems/vfs.txt (in order to
> > > add documentation for freepage) I was surprised to read that the
> > > ->releasepage() is itself supposed to be allowed to actually remove the
> > > page from the address space if it so desires.
> >
> > That doesn't sound right. It came from Neil in 2006.
> >
> > Neil, what were you thinking there? Did you find such a ->releasepage()?
>
> Nope, no idea, sorry.
>
> No releasepage functions do anything like that, and no call sites suggest it
> could be a possibility. Quite the reverse - they are likely to remove the
> page from the mapping without checking that it is still in the mapping.
>
> So that sentence should be deleted.
This?
From: Andrew Morton <akpm@...ux-foundation.org>
->releasepage() does not remove the page from the mapping.
Cc: Neil Brown <neilb@...e.de>
Cc: Trond Myklebust <Trond.Myklebust@...app.com>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---
Documentation/filesystems/vfs.txt | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff -puN Documentation/filesystems/vfs.txt~documentation-filesystems-vfstxt-fix-repeasepage-description Documentation/filesystems/vfs.txt
--- a/Documentation/filesystems/vfs.txt~documentation-filesystems-vfstxt-fix-repeasepage-description
+++ a/Documentation/filesystems/vfs.txt
@@ -660,11 +660,10 @@ struct address_space_operations {
releasepage: releasepage is called on PagePrivate pages to indicate
that the page should be freed if possible. ->releasepage
should remove any private data from the page and clear the
- PagePrivate flag. It may also remove the page from the
- address_space. If this fails for some reason, it may indicate
- failure with a 0 return value.
- This is used in two distinct though related cases. The first
- is when the VM finds a clean page with no active users and
+ PagePrivate flag. If releasepage() fails for some reason, it must
+ indicate failure with a 0 return value.
+ releasepage() is used in two distinct though related cases. The
+ first is when the VM finds a clean page with no active users and
wants to make it a free page. If ->releasepage succeeds, the
page will be removed from the address_space and become free.
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists