NACK, this change is inconsistent. Either we check everything that sends
data or none.

I am not happy to have this kind of inconsistencies only to shutup coverity.

Fabio

On 6/14/2013 10:18 AM, Jan Friesse wrote:
> Signed-off-by: Jan Friesse <[email protected]>
> ---
>  exec/votequorum.c |   37 +++++++++++++++++++++++++------------
>  1 files changed, 25 insertions(+), 12 deletions(-)
> 
> diff --git a/exec/votequorum.c b/exec/votequorum.c
> index 4c3532c..84206c0 100644
> --- a/exec/votequorum.c
> +++ b/exec/votequorum.c
> @@ -1924,8 +1924,16 @@ static int votequorum_sync_process (void)
>       votequorum_exec_send_nodeinfo(us->node_id);
>       votequorum_exec_send_nodeinfo(VOTEQUORUM_QDEVICE_NODEID);
>       if (strlen(qdevice_name)) {
> -             
> votequorum_exec_send_qdevice_reg(VOTEQUORUM_QDEVICE_OPERATION_REGISTER,
> -                                              qdevice_name);
> +             if 
> (votequorum_exec_send_qdevice_reg(VOTEQUORUM_QDEVICE_OPERATION_REGISTER,
> +                                              qdevice_name) != 0) {
> +                     /*
> +                      * There is no easy way how to handle
> +                      * votequorum_exec_send_qdevice_reg failure in 
> sync_process, but
> +                      * user should be at least informed.
> +                      */
> +                     log_printf(LOGSYS_LEVEL_WARNING,
> +                                "Unable to send qdevice registration request 
> to cluster");
> +             }
>       }
>       return 0;
>  }
> @@ -2357,17 +2365,22 @@ static void 
> message_handler_req_lib_votequorum_qdevice_unregister (void *conn,
>                       error = CS_ERR_INVALID_PARAM;
>                       goto out;
>               }
> -             if (qdevice_timer_set) {
> -                     corosync_api->timer_delete(qdevice_timer);
> -                     qdevice_timer_set = 0;
> -             }
> -             us->flags &= ~NODE_FLAGS_QDEVICE_REGISTERED;
> -             us->flags &= ~NODE_FLAGS_QDEVICE_ALIVE;
> -             us->flags &= ~NODE_FLAGS_QDEVICE_CAST_VOTE;
> -             us->flags &= ~NODE_FLAGS_QDEVICE_MASTER_WINS;
>               votequorum_exec_send_nodeinfo(us->node_id);
> -             
> votequorum_exec_send_qdevice_reg(VOTEQUORUM_QDEVICE_OPERATION_UNREGISTER,
> -                                              
> req_lib_votequorum_qdevice_unregister->name);
> +             if 
> (votequorum_exec_send_qdevice_reg(VOTEQUORUM_QDEVICE_OPERATION_UNREGISTER,
> +                                              
> req_lib_votequorum_qdevice_unregister->name) != 0) {
> +                     log_printf(LOGSYS_LEVEL_WARNING,
> +                                "Unable to send qdevice unregistration 
> request to cluster");
> +                     error = CS_ERR_TRY_AGAIN;
> +             } else {
> +                     if (qdevice_timer_set) {
> +                             corosync_api->timer_delete(qdevice_timer);
> +                             qdevice_timer_set = 0;
> +                     }
> +                     us->flags &= ~NODE_FLAGS_QDEVICE_REGISTERED;
> +                     us->flags &= ~NODE_FLAGS_QDEVICE_ALIVE;
> +                     us->flags &= ~NODE_FLAGS_QDEVICE_CAST_VOTE;
> +                     us->flags &= ~NODE_FLAGS_QDEVICE_MASTER_WINS;
> +             }
>       } else {
>               error = CS_ERR_NOT_EXIST;
>       }
> 

_______________________________________________
discuss mailing list
[email protected]
http://lists.corosync.org/mailman/listinfo/discuss

Reply via email to