[sheepdog] [PATCH UPDATE] sheep: fix a bug of objects loss when some node has zone set to 0

Liu Yuan namei.unix at gmail.com
Sun Aug 5 14:04:20 CEST 2012


On 08/04/2012 07:38 PM, levin li wrote:
> From: levin li <xingke.lwp at taobao.com>
> 
> Before the patch 5b27736abffc3fe569b4ec5335806ad345e279b9 it's OK
> to set zone to 0, because we skip the same node in get_nth_page(),
> but after that patch, we just check same_zone() in get_nth_page(),
> and same_zone() return false when zone of some node is 0, so there's
> problem, it's reasonable for users to set zone to 0, so this patch
> fixes this problem
> 
> Signed-off-by: levin li <xingke.lwp at taobao.com>
> ---
>  include/sheep.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/sheep.h b/include/sheep.h
> index 5795111..ef8dc22 100644
> --- a/include/sheep.h
> +++ b/include/sheep.h
> @@ -57,7 +57,7 @@ static inline int same_node(struct sd_vnode *e, int n1, int n2)
>  
>  static inline int same_zone(struct sd_vnode *e, int n1, int n2)
>  {
> -	return e[n1].zone != 0 && e[n1].zone == e[n2].zone;
> +	return e[n1].zone == e[n2].zone;
>  }
>  
>  /* traverse the virtual node list and return the n'th one */
> 

Applied, thanks.

Yuan



More information about the sheepdog mailing list