[sheepdog-users] [PATCH stable-0.7 1/2] sheep: remove invalid usage of current_vnode_info

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Mon Jan 6 10:58:56 CET 2014


The variable current_vnode_info should be treated with the functions
get_vnode_info() and put_vnode_info(). But some part of group.c didn't
follow this rule. This patch fixes the clear problem in
update_cluster_info(), sd_leave_handler() and kick_node_recover().

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix at gmail.com>

Conflicts:
	sheep/group.c

Conflicts were resolved by Hitoshi Mitake.
Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 sheep/group.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sheep/group.c b/sheep/group.c
index 78fd713..14314c3 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -641,7 +641,7 @@ static void update_cluster_info(const struct cluster_info *cinfo,
 	if (node_is_local(joined))
 		finish_join(nodes, nr_nodes);
 
-	old_vnode_info = main_thread_get(current_vnode_info);
+	old_vnode_info = get_vnode_info();
 	main_thread_set(current_vnode_info,
 			  alloc_vnode_info(nodes, nr_nodes));
 
@@ -915,7 +915,7 @@ main_fn void sd_leave_handler(const struct sd_node *left,
 		/* Mark leave node as gateway only node */
 		sys->this_node.nr_vnodes = 0;
 
-	old_vnode_info = main_thread_get(current_vnode_info);
+	old_vnode_info = get_vnode_info();
 	main_thread_set(current_vnode_info,
 			  alloc_vnode_info(members, nr_members));
 	if (sys->cinfo.status == SD_STATUS_OK) {
@@ -941,7 +941,7 @@ static void update_node_size(struct sd_node *node)
 
 static void kick_node_recover(void)
 {
-	struct vnode_info *old = main_thread_get(current_vnode_info);
+	struct vnode_info *old = get_vnode_info();
 	int ret;
 
 	main_thread_set(current_vnode_info,
-- 
1.7.10.4




More information about the sheepdog-users mailing list