summaryrefslogtreecommitdiffstats
path: root/mm/migrate.c
diff options
context:
space:
mode:
authorChristoph Lameter2007-03-05 09:30:33 +0100
committerLinus Torvalds2007-03-05 16:57:51 +0100
commit0dc952dc3e6d96d554a19fa7bee3f3b1d55e3cff (patch)
tree1dcf2ff93784716143b7acef816888a71a9504c2 /mm/migrate.c
parent[PATCH] fb: sm501fb off-by-1 sysfs store (diff)
downloadkernel-qcow2-linux-0dc952dc3e6d96d554a19fa7bee3f3b1d55e3cff.tar.gz
kernel-qcow2-linux-0dc952dc3e6d96d554a19fa7bee3f3b1d55e3cff.tar.xz
kernel-qcow2-linux-0dc952dc3e6d96d554a19fa7bee3f3b1d55e3cff.zip
[PATCH] Page migration: Fix vma flag checking
Currently we do not check for vma flags if sys_move_pages is called to move individual pages. If sys_migrate_pages is called to move pages then we check for vm_flags that indicate a non migratable vma but that still includes VM_LOCKED and we can migrate mlocked pages. Extract the vma_migratable check from mm/mempolicy.c, fix it and put it into migrate.h so that is can be used from both locations. Problem was spotted by Lee Schermerhorn Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/migrate.c')
-rw-r--r--mm/migrate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index e9b161bde95b..7a66ca25dc8a 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -781,7 +781,7 @@ static int do_move_pages(struct mm_struct *mm, struct page_to_node *pm,
err = -EFAULT;
vma = find_vma(mm, pp->addr);
- if (!vma)
+ if (!vma || !vma_migratable(vma))
goto set_status;
page = follow_page(vma, pp->addr, FOLL_GET);