Release page reference during page fault retry
authorMichel Lespinasse <walken@google.com>
Tue, 2 Nov 2010 20:05:18 +0000 (13:05 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 2 Nov 2010 21:02:31 +0000 (17:02 -0400)
This slipped by when unifying the filemap and swap versions of
lock_page_or_retry()...

Signed-off-by: Michel Lespinasse <walken@google.com>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/filemap.c

index 75572b5f23746a4b47a42920980a22e6a5251fe7..61ba5e405791918e2bab077144300b1d4d7ab6ce 100644 (file)
@@ -1563,8 +1563,10 @@ retry_find:
                        goto no_cached_page;
        }
 
-       if (!lock_page_or_retry(page, vma->vm_mm, vmf->flags))
+       if (!lock_page_or_retry(page, vma->vm_mm, vmf->flags)) {
+               page_cache_release(page);
                return ret | VM_FAULT_RETRY;
+       }
 
        /* Did it get truncated? */
        if (unlikely(page->mapping != mapping)) {