Przeglądaj źródła

votequorum: fix segfault in wfa status update

this is a regression introduced by cb5fd775

when reading static config us->flags does not exists yet and therefor
setting it will cause a segfault.

Move the settings after cluster_node *us is created, with the long
term plan to simply kill the whole _static readconfig bits
in favour of dynamic (runtime changeable) bits.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Fabio M. Di Nitto 14 lat temu
rodzic
commit
6a9e4760da
1 zmienionych plików z 4 dodań i 4 usunięć
  1. 4 4
      exec/votequorum.c

+ 4 - 4
exec/votequorum.c

@@ -913,10 +913,6 @@ static char *votequorum_readconfig_static(void)
 		return ((char *)"configuration error: quorum device is not compatible with auto_tie_breaker feature");
 		return ((char *)"configuration error: quorum device is not compatible with auto_tie_breaker feature");
 	}
 	}
 
 
-	if (wait_for_all) {
-		update_wait_for_all_status(1);
-	}
-
 	LEAVE();
 	LEAVE();
 
 
 	return (NULL);
 	return (NULL);
@@ -1687,6 +1683,10 @@ static char *votequorum_exec_init_fn (struct corosync_api_v1 *api)
 	us->votes = 1;
 	us->votes = 1;
 	us->flags |= NODE_FLAGS_FIRST;
 	us->flags |= NODE_FLAGS_FIRST;
 
 
+	if (wait_for_all) {
+		update_wait_for_all_status(1);
+	}
+
 	qdevice = allocate_node(NODEID_QDEVICE);
 	qdevice = allocate_node(NODEID_QDEVICE);
 	if (!qdevice) {
 	if (!qdevice) {
 		LEAVE();
 		LEAVE();