Re: [PATCH 8/9] votequorum: fix variable init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reviewed-by: Steven Dake <sdake@xxxxxxxxxx>

On 02/07/2012 03:22 AM, Fabio M. Di Nitto wrote:
> From: "Fabio M. Di Nitto" <fdinitto@xxxxxxxxxx>
> 
> Signed-off-by: Fabio M. Di Nitto <fdinitto@xxxxxxxxxx>
> ---
> :100644 100644 9084b93... cdc88e1... M	exec/votequorum.c
>  exec/votequorum.c |   17 ++++++++++++-----
>  1 files changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/exec/votequorum.c b/exec/votequorum.c
> index 9084b93..cdc88e1 100644
> --- a/exec/votequorum.c
> +++ b/exec/votequorum.c
> @@ -1039,7 +1039,7 @@ static void message_handler_req_exec_votequorum_nodeinfo (
>  	unsigned int nodeid)
>  {
>  	const struct req_exec_quorum_nodeinfo *req_exec_quorum_nodeinfo = message;
> -	struct cluster_node *node;
> +	struct cluster_node *node = NULL;
>  	int old_votes;
>  	int old_expected;
>  	uint16_t old_flags;
> @@ -1070,10 +1070,17 @@ static void message_handler_req_exec_votequorum_nodeinfo (
>  		return;
>  	}
>  
> -	old_votes = node->votes;
> -	old_expected = node->expected_votes;
> -	old_state = node->state;
> -	old_flags = node->flags;
> +	if (new_node) {
> +		old_votes = 0;
> +		old_expected = 0;
> +		old_state = NODESTATE_DEAD;
> +		old_flags = 0;
> +	} else {
> +		old_votes = node->votes;
> +		old_expected = node->expected_votes;
> +		old_state = node->state;
> +		old_flags = node->flags;
> +	}
>  
>  	/* Update node state */
>  	node->votes = req_exec_quorum_nodeinfo->votes;

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux