[sheepdog] [PATCH v3] recovery: avoid recovering object from node left

levin li levin108 at gmail.com
Thu May 24 11:08:42 CEST 2012


On 05/24/2012 04:56 PM, Christoph Hellwig wrote:
> On Thu, May 24, 2012 at 04:55:05PM +0800, levin li wrote:
>> On 05/24/2012 04:51 PM, Christoph Hellwig wrote:
>>>> +++ b/include/sheep.h
>>>> @@ -155,9 +155,9 @@ struct sd_node {
>>>>  };
>>>>  
>>>>  struct sd_vnode {
>>>> -	uint64_t        id;
>>>>  	uint8_t         addr[16];
>>>>  	uint16_t        port;
>>>> +	uint64_t        id;
>>>>  	uint16_t	node_idx;
>>>>  	uint32_t	zone;
>>>>  };
>>>
>>> Why do you need to change the sd_vnode layout?  Especially as the new
>>> one has a much less efficient layout.
>>>
>>
>> We make it has the same layout as sd_node which set addr and port in the
>> head, then we can use node_cmp to compare sd_node and sd_vnode.
> 
> Bad idea - assuming different types have the same layout just leads to
> future bugs.  Please just write different compare functions for the
> node and vnode.
> 

Well.. OK, I'd implement another compare function.

thanks,

levin



More information about the sheepdog mailing list