lkml.org 
[lkml]   [2010]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 3/3] NFS: Fix a memory leak in nfs_readdir
On Wed, Dec 1, 2010 at 12:10 PM, Trond Myklebust
<Trond.Myklebust@netapp.com> wrote:
>
> Something like the following then?
> diff --git a/mm/truncate.c b/mm/truncate.c
> index ba887bf..76ab2a8 100644
> --- a/mm/truncate.c
> +++ b/mm/truncate.c
> @@ -108,6 +108,10 @@ truncate_complete_page(struct address_space *mapping, struct page *page)
>        clear_page_mlock(page);
>        remove_from_page_cache(page);
>        ClearPageMappedToDisk(page);
> +
> +       if (mapping->a_ops->freepage)
> +               mapping->a_ops->freepage(page);
> +
>        page_cache_release(page);       /* pagecache ref */
>        return 0;
>  }

I'd do this in "remove_from_page_cache()" instead of in
"truncate_complete_page()". Otherwise it will miss any other callers
that use "remove_from_page_cache()" (not that there are many, and I
doubt NFS cares about the ones that do exists, but..)

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-12-01 21:21    [W:0.127 / U:1.048 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site