[Sheepdog] [PATCH 1/2] sheep: fix epoch_log_read_nr()

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Wed Dec 28 17:48:36 CET 2011


At Wed, 21 Dec 2011 00:22:03 +0800,
Liu Yuan wrote:
> 
> From: Liu Yuan <tailai.ly at taobao.com>
> 
> We should propagate error out to the caller.
> 
> - remove whitespace in passing
> 
> Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
> ---
>  sheep/store.c |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)

Applied the first patch in this series, thanks!

The second one is probably okay, but it is not obvious that the patch
doesn't hurt the current object recovery.  I'll postpone it for 0.4.0.

Thanks,

Kazutaka

> 
> diff --git a/sheep/store.c b/sheep/store.c
> index 4c4f0da..fed74f8 100644
> --- a/sheep/store.c
> +++ b/sheep/store.c
> @@ -805,11 +805,13 @@ out:
>  
>  int epoch_log_read_nr(uint32_t epoch, char *buf, int len)
>  {
> -        int nr;
> +	int nr;
>  
> -        nr = epoch_log_read(epoch, buf, len);
> -        nr /= sizeof(struct sheepdog_node_list_entry);
> -        return nr;
> +	nr = epoch_log_read(epoch, buf, len);
> +	if (nr < 0)
> +		return nr;
> +	nr /= sizeof(struct sheepdog_node_list_entry);
> +	return nr;
>  }
>  
>  int epoch_log_read(uint32_t epoch, char *buf, int len)
> -- 
> 1.7.8.rc3
> 
> -- 
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog



More information about the sheepdog mailing list