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

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Sat Aug 4 08:50:07 CEST 2012


At Fri,  3 Aug 2012 16:38:42 +0800,
levin li wrote:
> 
> From: levin li <xingke.lwp at taobao.com>
> 
> Before the patch 64233f7c16d6eafc5b981e5e5405923dfbd99b10 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 files changed, 1 insertions(+), 1 deletions(-)
> 
> 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;
>  }

I think this patch is a correct fix, but can you explain why it was
not a problem before the patch 64233f7 (object cache: add a
object_list for cache entry for cache deleting) more clearly?  Are
there any examples?

Thanks,

Kazutaka



More information about the sheepdog mailing list