[sheepdog] [PATCH 2/2] sheep: fix error handling in local_stat_cluster

Liu Yuan namei.unix at gmail.com
Wed Jun 6 04:40:07 CEST 2012


On 06/05/2012 07:53 PM, Christoph Hellwig wrote:

> -		if (log->nr_nodes == -1)
> +		if (log->nr_nodes == -1) {
>  			log->nr_nodes = epoch_log_read_remote(epoch,
>  							      (char *)log->nodes,
>  							      sizeof(log->nodes));
> +		}
> +		if (log->nr_nodes == -1) {
> +			eprintf("Failed to read log for epoch %d\n", i);
> +			break;
> +		}
> +


epoch_log_read_remote() doesn't return -1, so no need to check it. Also
need remove {} for one liner if clause.

Thanks,
Yuan



More information about the sheepdog mailing list