[sheepdog] [PATCH] sheep: fix node comparism in log_last_epoch

Yunkai Zhang yunkai.me at gmail.com
Thu May 17 17:27:52 CEST 2012


On Thu, May 17, 2012 at 11:13 PM, Christoph Hellwig <hch at infradead.org> wrote:
> We only logged the joining node instead of all previous nodes due to a
> rebase error over the node_eq changes, causing major confusion during
> recovery.

I have tested this patch, it works.

>
> Signed-off-by: Christoph Hellwig <hch at lst.de>
>
> diff --git a/sheep/group.c b/sheep/group.c
> index 8903034..a4a9dbe 100644
> --- a/sheep/group.c
> +++ b/sheep/group.c
> @@ -588,7 +588,7 @@ static void log_last_epoch(struct join_message *msg, struct sd_node *joined,
>
>                /* exclude the newly added one */
>                for (i = 0; i < nr_nodes; i++) {
> -                       if (node_eq(nodes + i, joined))
> +                       if (!node_eq(nodes + i, joined))
>                                old_nodes[count++] = nodes[i];
>                }
>                qsort(old_nodes, count, sizeof(struct sd_node), node_cmp);
> --
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog



-- 
Yunkai Zhang
Work at Taobao



More information about the sheepdog mailing list