[Ocfs2-tools-devel] [PATCH] libo2cb: stop heartbeat on error

Eric Ren zren at suse.com
Mon Mar 5 19:17:09 PST 2018



On 03/05/2018 08:49 PM, piaojun wrote:
> We should clean up heartbeat region if error happens in __o2cb_get_ref(),
> as heartbeat region will be left over after mount failed.
>
> Signed-off-by: Jun Piao <piaojun at huawei.com>

Looks good to me.

Reviewed-by: Eric Ren <zren at suse.com>

Thanks,
Eric

> ---
>   libo2cb/o2cb_abi.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/libo2cb/o2cb_abi.c b/libo2cb/o2cb_abi.c
> index 6609aa4..69148dc 100644
> --- a/libo2cb/o2cb_abi.c
> +++ b/libo2cb/o2cb_abi.c
> @@ -1259,6 +1259,9 @@ errcode_t o2cb_start_heartbeat(struct o2cb_cluster_desc *cluster,
>
>   	ret = __o2cb_get_ref(semid, !region->r_persist);
>   	/* XXX: Maybe stop heartbeat on error here? */
> +	if (ret)
> +		o2cb_remove_heartbeat_region(cluster->c_cluster,
> +					   region->r_name);
>   up:
>   	up_ret = o2cb_mutex_up(semid);
>   	if (up_ret && !ret)




More information about the Ocfs2-tools-devel mailing list