]> git.baikalelectronics.ru Git - kernel.git/commit
NOMMU: Fix __get_user_pages() to pin last page on offset buffers
authorDavid Howells <dhowells@redhat.com>
Thu, 25 Mar 2010 16:48:44 +0000 (16:48 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 25 Mar 2010 21:13:27 +0000 (14:13 -0700)
commit644067baac183a43c02500550603437f775fe621
tree5de7d6dd923a04eda69fdedd1209ea249ef081cf
parent5ed04b460ccc5d70dbd5a584fdb13a4188bb145e
NOMMU: Fix __get_user_pages() to pin last page on offset buffers

Fix __get_user_pages() to make it pin the last page on a buffer that doesn't
begin at the start of a page, but is a multiple of PAGE_SIZE in size.

The problem is that __get_user_pages() advances the pointer too much when it
iterates to the next page if the page it's currently looking at isn't used from
the first byte.  This can cause the end of a short VMA to be reached
prematurely, resulting in the last page being lost.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/nommu.c