[PATCH] Exit with ctdb_fatal if serverids_exist fails

Michael Adam obnox at samba.org
Sat May 24 05:38:59 MDT 2014


pushed

On 2014-05-22 at 16:00 -0700, Christof Schmitt wrote:
> >From 4081166a79e89a21ba34fa48ececbe344010b048 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Thu, 4 Jul 2013 14:22:28 +0200
> Subject: [PATCH] Exit with ctdb_fatal if serverids_exist fails
> 
> The only reason why this could fail is a severe ctdb communications
> problem. The normal way to deal with this is ctdb_fatal. This avoids a
> confusing panic in get_share_mode_lock when ctdb is shutdown while this
> call happens.
> 
> Signed-off-by: Volker Lendecke <vl at samba.org>
> Reviewed-by: Christof Schmitt <cs at samba.org>
> ---
>  source3/lib/ctdbd_conn.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
> index fae3f90..35845ed 100644
> --- a/source3/lib/ctdbd_conn.c
> +++ b/source3/lib/ctdbd_conn.c
> @@ -1166,7 +1166,6 @@ bool ctdb_serverids_exist(struct ctdbd_connection *conn,
>  	NTSTATUS status;
>  	struct ctdb_vnn_list *vnns = NULL;
>  	unsigned num_vnns;
> -	bool result = false;
>  
>  	if (!ctdb_collect_vnns(talloc_tos(), pids, num_pids,
>  			       &vnns, &num_vnns)) {
> @@ -1303,10 +1302,11 @@ bool ctdb_serverids_exist(struct ctdbd_connection *conn,
>  		num_received += 1;
>  	}
>  
> -	result = true;
> -fail:
>  	TALLOC_FREE(vnns);
> -	return result;
> +	return true;
> +fail:
> +	cluster_fatal("serverids_exist failed");
> +	return false;
>  #endif /* HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL */
>  }
>  
> -- 
> 1.7.1
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140524/2a55e1af/attachment.pgp>


More information about the samba-technical mailing list