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

levin li levin108 at gmail.com
Sat Aug 4 12:35:01 CEST 2012


On 08/04/2012 02:50 PM, MORITA Kazutaka wrote:
> 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
> 

Oops, sorry, I referenced a wrong commit, it should be 5b27736abffc3fe569b4ec5335806ad345e279b9:

    remove duplicated check in get_nth_node
    
    The same node is per defintion also in the same zone, so remove the duplicate
    check.


thanks

levin



More information about the sheepdog mailing list