]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.35.8/mm-move-vma_stack_continue-into-mm.h.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.35.8 / mm-move-vma_stack_continue-into-mm.h.patch
1 From 39aa3cb3e8250db9188a6f1e3fb62ffa1a717678 Mon Sep 17 00:00:00 2001
2 From: Stefan Bader <stefan.bader@canonical.com>
3 Date: Tue, 31 Aug 2010 15:52:27 +0200
4 Subject: mm: Move vma_stack_continue into mm.h
5
6 From: Stefan Bader <stefan.bader@canonical.com>
7
8 commit 39aa3cb3e8250db9188a6f1e3fb62ffa1a717678 upstream.
9
10 So it can be used by all that need to check for that.
11
12 Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
13 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15
16 ---
17 fs/proc/task_mmu.c | 3 ++-
18 include/linux/mm.h | 6 ++++++
19 mm/mlock.c | 6 ------
20 3 files changed, 8 insertions(+), 7 deletions(-)
21
22 --- a/fs/proc/task_mmu.c
23 +++ b/fs/proc/task_mmu.c
24 @@ -224,7 +224,8 @@ static void show_map_vma(struct seq_file
25 /* We don't show the stack guard page in /proc/maps */
26 start = vma->vm_start;
27 if (vma->vm_flags & VM_GROWSDOWN)
28 - start += PAGE_SIZE;
29 + if (!vma_stack_continue(vma->vm_prev, vma->vm_start))
30 + start += PAGE_SIZE;
31
32 seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n",
33 start,
34 --- a/include/linux/mm.h
35 +++ b/include/linux/mm.h
36 @@ -863,6 +863,12 @@ int set_page_dirty(struct page *page);
37 int set_page_dirty_lock(struct page *page);
38 int clear_page_dirty_for_io(struct page *page);
39
40 +/* Is the vma a continuation of the stack vma above it? */
41 +static inline int vma_stack_continue(struct vm_area_struct *vma, unsigned long addr)
42 +{
43 + return vma && (vma->vm_end == addr) && (vma->vm_flags & VM_GROWSDOWN);
44 +}
45 +
46 extern unsigned long move_page_tables(struct vm_area_struct *vma,
47 unsigned long old_addr, struct vm_area_struct *new_vma,
48 unsigned long new_addr, unsigned long len);
49 --- a/mm/mlock.c
50 +++ b/mm/mlock.c
51 @@ -135,12 +135,6 @@ void munlock_vma_page(struct page *page)
52 }
53 }
54
55 -/* Is the vma a continuation of the stack vma above it? */
56 -static inline int vma_stack_continue(struct vm_area_struct *vma, unsigned long addr)
57 -{
58 - return vma && (vma->vm_end == addr) && (vma->vm_flags & VM_GROWSDOWN);
59 -}
60 -
61 static inline int stack_guard_page(struct vm_area_struct *vma, unsigned long addr)
62 {
63 return (vma->vm_flags & VM_GROWSDOWN) &&