]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.1.1/s390-gup_huge_pmd-return-0-if-pte-changes.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.1.1 / s390-gup_huge_pmd-return-0-if-pte-changes.patch
1 From 0693bc9ce2cc4f6a1b9c3c05790fc149a74c0b87 Mon Sep 17 00:00:00 2001
2 From: Andrea Arcangeli <aarcange@redhat.com>
3 Date: Wed, 2 Nov 2011 13:37:28 -0700
4 Subject: s390: gup_huge_pmd() return 0 if pte changes
5
6 From: Andrea Arcangeli <aarcange@redhat.com>
7
8 commit 0693bc9ce2cc4f6a1b9c3c05790fc149a74c0b87 upstream.
9
10 s390 didn't return 0 in that case, if it's rolling back the *nr pointer it
11 should also return zero to avoid adding pages to the array at the wrong
12 offset.
13
14 Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
15 Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
16 Cc: Hugh Dickins <hughd@google.com>
17 Cc: Johannes Weiner <jweiner@redhat.com>
18 Cc: Rik van Riel <riel@redhat.com>
19 Cc: Mel Gorman <mgorman@suse.de>
20 Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
21 Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
22 Cc: David Gibson <david@gibson.dropbear.id.au>
23 Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
24 Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
25 Cc: David Miller <davem@davemloft.net>
26 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
27 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
28 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
29
30 ---
31 arch/s390/mm/gup.c | 21 +++++++++++----------
32 1 file changed, 11 insertions(+), 10 deletions(-)
33
34 --- a/arch/s390/mm/gup.c
35 +++ b/arch/s390/mm/gup.c
36 @@ -93,16 +93,17 @@ static inline int gup_huge_pmd(pmd_t *pm
37 *nr -= refs;
38 while (refs--)
39 put_page(head);
40 - } else {
41 - /*
42 - * Any tail page need their mapcount reference taken
43 - * before we return.
44 - */
45 - while (refs--) {
46 - if (PageTail(tail))
47 - get_huge_page_tail(tail);
48 - tail++;
49 - }
50 + return 0;
51 + }
52 +
53 + /*
54 + * Any tail page need their mapcount reference taken before we
55 + * return.
56 + */
57 + while (refs--) {
58 + if (PageTail(tail))
59 + get_huge_page_tail(tail);
60 + tail++;
61 }
62
63 return 1;