From c44a97dfa14d5a702aebbe54906bca87dbdc3b93 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Thu, 26 Jul 2012 22:01:50 +1000 Subject: util: Do not lock down memory when running with local daemons Thanks to Ronnie for highlighting the issue of memory lockdown on AIX. Fix typo, use getuid and not getpid. Signed-off-by: Amitay Isaacs (This used to be ctdb commit 21a5cbf9518fafc610939f14874371a52b1dc8b3) --- ctdb/common/ctdb_util.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ctdb/common') diff --git a/ctdb/common/ctdb_util.c b/ctdb/common/ctdb_util.c index 30effdd52e..ed322ac8b7 100644 --- a/ctdb/common/ctdb_util.c +++ b/ctdb/common/ctdb_util.c @@ -642,8 +642,13 @@ void ctdb_lockdown_memory(struct ctdb_context *ctdb) return; } + /* TODO: Add a command line option to disable memory lockdown. + * This can be a performance issue on AIX since fork() copies + * all locked memory pages. + */ + /* Ignore when running in local daemons mode */ - if (getpid() != 0) { + if (getuid() != 0) { return; } -- cgit