diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2010-11-10 04:05:51 -0500 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-11-10 04:05:53 -0500 |
commit | 25591b07033663e09f5e60355fc5ec4d4aa53e63 (patch) | |
tree | ab42df338d8cc5252116fb3345876a95ade0b5c0 /arch/s390/mm | |
parent | f6614b7bb405a9b35dd28baea989a749492c46b2 (diff) |
[S390] fix get_user_pages_fast
The check for the _PAGE_RO bit in get_user_pages_fast for write==1 is
the wrong way around. It must not be set for the fast path.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r-- | arch/s390/mm/gup.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/s390/mm/gup.c b/arch/s390/mm/gup.c index 38e641cdd977..45b405ca2567 100644 --- a/arch/s390/mm/gup.c +++ b/arch/s390/mm/gup.c | |||
@@ -20,18 +20,17 @@ | |||
20 | static inline int gup_pte_range(pmd_t *pmdp, pmd_t pmd, unsigned long addr, | 20 | static inline int gup_pte_range(pmd_t *pmdp, pmd_t pmd, unsigned long addr, |
21 | unsigned long end, int write, struct page **pages, int *nr) | 21 | unsigned long end, int write, struct page **pages, int *nr) |
22 | { | 22 | { |
23 | unsigned long mask, result; | 23 | unsigned long mask; |
24 | pte_t *ptep, pte; | 24 | pte_t *ptep, pte; |
25 | struct page *page; | 25 | struct page *page; |
26 | 26 | ||
27 | result = write ? 0 : _PAGE_RO; | 27 | mask = (write ? _PAGE_RO : 0) | _PAGE_INVALID | _PAGE_SPECIAL; |
28 | mask = result | _PAGE_INVALID | _PAGE_SPECIAL; | ||
29 | 28 | ||
30 | ptep = ((pte_t *) pmd_deref(pmd)) + pte_index(addr); | 29 | ptep = ((pte_t *) pmd_deref(pmd)) + pte_index(addr); |
31 | do { | 30 | do { |
32 | pte = *ptep; | 31 | pte = *ptep; |
33 | barrier(); | 32 | barrier(); |
34 | if ((pte_val(pte) & mask) != result) | 33 | if ((pte_val(pte) & mask) != 0) |
35 | return 0; | 34 | return 0; |
36 | VM_BUG_ON(!pfn_valid(pte_pfn(pte))); | 35 | VM_BUG_ON(!pfn_valid(pte_pfn(pte))); |
37 | page = pte_page(pte); | 36 | page = pte_page(pte); |