]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] Fix sys_migrate_pages: Move all pages when invoked from root
authorChristoph Lameter <clameter@engr.sgi.com>
Wed, 1 Mar 2006 00:58:57 +0000 (16:58 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 1 Mar 2006 04:53:43 +0000 (20:53 -0800)
Currently sys_migrate_pages only moves pages belonging to a process.  This
is okay when invoked from a regular user.  But if invoked from root it
should move all pages as documented in the migrate_pages manpage.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/mempolicy.c

index 67af4cea1e23173dd918de5813bd591eb68423b3..5643cfed6b0f3e038ff078b561c5a1e216e8216b 100644 (file)
@@ -954,7 +954,8 @@ asmlinkage long sys_migrate_pages(pid_t pid, unsigned long maxnode,
                goto out;
        }
 
-       err = do_migrate_pages(mm, &old, &new, MPOL_MF_MOVE);
+       err = do_migrate_pages(mm, &old, &new,
+               capable(CAP_SYS_ADMIN) ? MPOL_MF_MOVE_ALL : MPOL_MF_MOVE);
 out:
        mmput(mm);
        return err;