Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 511030bc authored by Christoph Lameter's avatar Christoph Lameter Committed by Linus Torvalds
Browse files

[PATCH] Fix sys_migrate_pages: Move all pages when invoked from root



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: default avatarChristoph Lameter <clameter@sgi.com>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5cf6c541
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;