[PATCH]fix page release issue in filemap_fault - Kernel

This is a discussion on [PATCH]fix page release issue in filemap_fault - Kernel ; Hi all find_lock_page increases page's usage count, we should decrease it before return VM_FAULT_SIGBUS Signed-off-by: Yan Zheng ---- diff -ur linux-2.6.23-rc9/mm/filemap.c linux/mm/filemap.c --- linux-2.6.23-rc9/mm/filemap.c 2007-10-07 15:03:33.000000000 +0800 +++ linux/mm/filemap.c 2007-10-08 23:14:39.000000000 +0800 @@ -1388,6 +1388,7 @@ size = (i_size_read(inode) + ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: [PATCH]fix page release issue in filemap_fault

  1. [PATCH]fix page release issue in filemap_fault

    Hi all

    find_lock_page increases page's usage count, we should decrease it
    before return VM_FAULT_SIGBUS

    Signed-off-by: Yan Zheng
    ----
    diff -ur linux-2.6.23-rc9/mm/filemap.c linux/mm/filemap.c
    --- linux-2.6.23-rc9/mm/filemap.c 2007-10-07 15:03:33.000000000 +0800
    +++ linux/mm/filemap.c 2007-10-08 23:14:39.000000000 +0800
    @@ -1388,6 +1388,7 @@
    size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
    if (unlikely(vmf->pgoff >= size)) {
    unlock_page(page);
    + page_cache_release(page);
    goto outside_data_content;
    }
    -
    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/

  2. Re: [PATCH]fix page release issue in filemap_fault

    On Mon, 2007-10-08 at 23:28 +0800, Yan Zheng wrote:
    > Hi all
    >
    > find_lock_page increases page's usage count, we should decrease it
    > before return VM_FAULT_SIGBUS
    >
    > Signed-off-by: Yan Zheng


    Nice catch, .23 material?

    Acked-by: Peter Zijlstra

    > ----
    > diff -ur linux-2.6.23-rc9/mm/filemap.c linux/mm/filemap.c
    > --- linux-2.6.23-rc9/mm/filemap.c 2007-10-07 15:03:33.000000000 +0800
    > +++ linux/mm/filemap.c 2007-10-08 23:14:39.000000000 +0800
    > @@ -1388,6 +1388,7 @@
    > size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
    > if (unlikely(vmf->pgoff >= size)) {
    > unlock_page(page);
    > + page_cache_release(page);
    > goto outside_data_content;
    > }


    -
    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/

  3. Re: [PATCH]fix page release issue in filemap_fault

    On Mon, 08 Oct 2007 19:15:23 +0200
    Peter Zijlstra wrote:
    > On Mon, 2007-10-08 at 23:28 +0800, Yan Zheng wrote:
    > > Hi all
    > >
    > > find_lock_page increases page's usage count, we should decrease it
    > > before return VM_FAULT_SIGBUS
    > >
    > > Signed-off-by: Yan Zheng

    >
    > Nice catch, .23 material?


    An obvious fix for a memory leak. I think it should go in.

    > Acked-by: Peter Zijlstra


    Acked-by: Rik van Riel

    --
    "Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are,
    by definition, not smart enough to debug it." - Brian W. Kernighan
    -
    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/

+ Reply to Thread