[Ocfs2-tools-devel] [PATCH 15/25] o2cb: Add ops start-heartbeat and stop-heartbeat
Sunil Mushran
sunil.mushran at oracle.com
Wed Jun 30 14:03:41 PDT 2010
On 06/23/2010 08:19 PM, Joel Becker wrote:
>> +static errcode_t start_heartbeat(struct o2cb_device *od)
>> +{
>> + errcode_t ret = O2CB_ET_UNKNOWN_REGION;
>> +
>> + if (!(od->od_flags& O2CB_DEVICE_FOUND)) {
>> + tcom_err(ret, "%s", od->od_uuid);
>> + goto bail;
>> + }
>> +
>> + verbosef(VL_DEBUG, "Starting heartbeat on region %s, device %s\n",
>> + od->od_region.r_name, od->od_region.r_device_name);
>> + ret = o2cb_start_heartbeat(&od->od_cluster,&od->od_region);
>> + if (ret) {
>> + if (ret == O2CB_ET_REGION_EXISTS)
>> + ret = 0;
>> + tcom_err(ret, "unable to start hb on uuid %s", od->od_uuid);
>> + goto bail;
>>
> Why are you printing an error even if it has already been
> started? Imagine I've got global heartbeat running, then I add a new
> region, then I call start-heartbeat to enable it. Should I print an
> error on all the existing regions?
>
It won't. o2cb_start_heartbeat() will return 0 for regions on
which the heartbeat has already been started.
More information about the Ocfs2-tools-devel
mailing list