linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Fix sys_migrate_pages: Move all pages when invoked from root
@ 2006-02-25  0:17 Christoph Lameter
  2006-02-25  0:47 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Lameter @ 2006-02-25  0:17 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm

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>

Index: linux-2.6.16-rc4/mm/mempolicy.c
===================================================================
--- linux-2.6.16-rc4.orig/mm/mempolicy.c	2006-02-24 14:32:02.000000000 -0800
+++ linux-2.6.16-rc4/mm/mempolicy.c	2006-02-24 15:44:24.000000000 -0800
@@ -940,7 +940,8 @@ asmlinkage long sys_migrate_pages(pid_t 
 		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;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-02-25  1:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-25  0:17 Fix sys_migrate_pages: Move all pages when invoked from root Christoph Lameter
2006-02-25  0:47 ` Andrew Morton
2006-02-25  0:57   ` Christoph Lameter
2006-02-25  1:15     ` Andrew Morton
2006-02-25  1:27       ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox