[Ocfs2-tools-devel] [PATCH 37/39] ocfs2_controld: Open and close checkpoints

Mark Fasheh mfasheh at suse.com
Tue May 27 17:49:52 PDT 2008


On Fri, Mar 14, 2008 at 04:53:00PM -0700, Joel Becker wrote:
> +/*
> + * Our retention-time scheme of 0 means that we need to create any
> + * checkpoint we want to update.  Nobody is writing to the same checkpoint
> + * at the same time.
> + */
> +static int call_ckpt_open(struct ckpt_handle *handle, int write)
> +{
> +	int rc, retrycount;
> +	char *reason;
> +	SaAisErrorT error;
> +	int flags = SA_CKPT_CHECKPOINT_READ;
> +
> +	if (write)
> +		flags |= (SA_CKPT_CHECKPOINT_WRITE |
> +			  SA_CKPT_CHECKPOINT_CREATE);
> +
> +	for (retrycount = 0; retrycount < TENTATIVE_RETRY_TRIES; retrycount++) {
> +		log_debug("Opening checkpoint \"%.*s\" (try %d)",
> +			  handle->ch_name.length, handle->ch_name.value,
> +			  retrycount + 1);
> +		error = saCkptCheckpointOpen(daemon_handle,
> +					     &handle->ch_name,
> +					     write ? &ckpt_attributes : NULL,
> +					     flags, 0, &handle->ch_handle);
> +		ais_err_to_errno(error, &rc, &reason);
> +		if (!rc) {
> +			log_debug("Opened checkpoint \"%.*s\" with handle 0x%llx",
> +				  handle->ch_name.length,
> +				  handle->ch_name.value,
> +				  handle->ch_handle);
> +			break;
> +		}
> +		if ((rc != -EAGAIN) &&
> +		    (!write || (rc != -EEXIST))){
> +			log_error("Unable to open checkpoint \"%.*s\": %s",
> +				  handle->ch_name.length,
> +				  handle->ch_name.value,
> +				  reason);
> +			break;
> +		}
> +		if (write && (rc == -EEXIST))
> +			log_debug("Checkpoint \"%.*s\" exists, retrying after delay",
> +				  handle->ch_name.length,
> +				  handle->ch_name.value);

Can '(write && (rc == -EEXIST))' happen during 'normal' operations - i.e., there isn't a
serious error? If so, maybe we shouldn't count those in retrycount so we don't
error prematurely?
	--Mark

--
Mark Fasheh



More information about the Ocfs2-tools-devel mailing list