lkml.org 
[lkml]   [2010]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3/3] NFS: Fix a memory leak in nfs_readdir
On Wed, 1 Dec 2010, Andrew Morton wrote:
> On Wed, 01 Dec 2010 15:10:50 -0500
> Trond Myklebust <Trond.Myklebust@netapp.com> wrote:
>
> > --- a/include/linux/fs.h
> > +++ b/include/linux/fs.h
> > @@ -602,6 +602,7 @@ struct address_space_operations {
> > sector_t (*bmap)(struct address_space *, sector_t);
> > void (*invalidatepage) (struct page *, unsigned long);
> > int (*releasepage) (struct page *, gfp_t);
> > + void (*freepage)(struct page *);
> > ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
> > loff_t offset, unsigned long nr_segs);
> > int (*get_xip_mem)(struct address_space *, pgoff_t, int,
>
> It would be good to think about and then clearly spell out exactly what
> state the page is in here. It is locked, and I assume clean and not
> under writeback. What about its refcount, freezedness status and
> eligibility for lookups?
>
> And as Hugh pointed out, some callees might needs the address_space*
> although we can perhaps defer that until such a callee turns up.
> If/when that happens we might have a problem though: if this locked
> page is no longer attached to the address_space then what now pins the
> address_space, protecting it from inode reclaim?

That's an excellent point and trumps mine: it would be actively wrong
to provide the struct address_space *mapping arg I was asking for.
(Bet someone then tries stashing it away via page->private though.)

Hugh


\
 
 \ /
  Last update: 2010-12-01 22:05    [W:0.087 / U:0.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site