[sheepdog] [PATCH 1/2] trivial: pass pointers of node_id for node_id_cmp() in node_eq()

Liu Yuan namei.unix at gmail.com
Fri Nov 30 10:14:34 CET 2012


On 11/30/2012 04:51 PM, Hitoshi Mitake wrote:
> It seems that current node_eq() passes pointers of struct sd_node to
> node_id_cmp() as parameters even though node_id_cmp() assumes the
> parameters are pointers of node_id.
> 
> Currently, it works correctly because of the below 2 reasons:
> 1. types of parameters of node_id_cmp() are defined as void *.
>    It is for qsort()
> 2. nid of struct node_id is defined as the first member of the struct.
> 
> So this might not be a problem until the layout of struct sd_node is
> changed. But I think that it is dangerous and should be fixed.
> 
> It seems that this problem is caused by a change in the commit
> 349dab6735.

Applied these two.

Thanks,
Yuan



More information about the sheepdog mailing list