[PATCH] ctdb: simplify logic (Re: [PATCH] Fixes related to ctdb command line option --nosetsched)

Michael Adam obnox at samba.org
Mon Jun 20 09:39:42 UTC 2016


Hi,

attached find a follow-up patch to this patchset that
simplifies a bool assignment. Imho it reads more
naturally like this.

Review appreciated!

Michael


On 2016-06-20 at 17:51 +1000, Amitay Isaacs wrote:
> Hi,
> 
> These patches fix two issues:
> 
> 1. If --nosetsched option is specified to ctdbd, then ctdb_lock_helper
> should not try to set real-time priority.  This avoids annoying log
> messages in local daemons test.
> 
> 2. There is no way of setting --nosetsched via ctdbd_wrapper.  The problem
> was noticed at SambaXP when Kai was building a cluster of Raspberry Pi,
> where the linux kernel did not support SCHED_FIFO for some reason.
> 
> Please review and push.
> 
> Amitay.


-------------- next part --------------
From 5f04197cf898ec7c42ee46328aaf71138609a5f0 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Mon, 20 Jun 2016 10:42:43 +0200
Subject: [PATCH] ctdb-daemon: simplify logic in assignment of bool value

Signed-off-by: Michael Adam <obnox at samba.org>
---
 ctdb/server/ctdbd.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c
index 420add4..4cf6680 100644
--- a/ctdb/server/ctdbd.c
+++ b/ctdb/server/ctdbd.c
@@ -294,12 +294,7 @@ int main(int argc, const char *argv[])
 	}
 
 	ctdb->valgrinding = (options.valgrinding == 1);
-	if ((options.valgrinding == 1) || (options.nosetsched == 1)) {
-		ctdb->do_setsched = false;
-	} else {
-		ctdb->do_setsched = true;
-	}
-
+	ctdb->do_setsched = (options.nosetsched != 1) && !ctdb->valgrinding;
 	ctdb->public_addresses_file = options.public_address_list;
 	ctdb->do_checkpublicip = (options.no_publicipcheck == 0);
 
-- 
2.5.5

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160620/9aed3d82/signature.sig>


More information about the samba-technical mailing list