[sheepdog-users] [PATCH stable-0.7] Revert "sheep: remove invalid usage of current_vnode_info"

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Thu Jan 9 03:52:20 CET 2014


This reverts commit e2a8b0605e85fcae742738dd5ca518ea4ea3bd44.

The commit replaced main_thread_get() with get_vnode_info(). But the change was
invalid because if we use get_vnode_info() for old_vnode_info, the reference
count never reaches to 0. It causes resource leak. This patch reverts the
commit.

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 7e60378..e2cc3fe 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -645,7 +645,7 @@ static void update_cluster_info(const struct cluster_info *cinfo,
 	if (node_is_local(joined))
 		finish_join(nodes, nr_nodes);
 
-	old_vnode_info = get_vnode_info();
+	old_vnode_info = main_thread_get(current_vnode_info);
 	main_thread_set(current_vnode_info,
 			  alloc_vnode_info(nodes, nr_nodes));
 
@@ -919,7 +919,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 = get_vnode_info();
+	old_vnode_info = main_thread_get(current_vnode_info);
 	main_thread_set(current_vnode_info,
 			  alloc_vnode_info(members, nr_members));
 	if (sys->cinfo.status == SD_STATUS_OK) {
@@ -947,7 +947,7 @@ static void update_node_size(struct sd_node *node)
 
 static void kick_node_recover(void)
 {
-	struct vnode_info *old = get_vnode_info();
+	struct vnode_info *old = main_thread_get(current_vnode_info);
 	int ret;
 
 	main_thread_set(current_vnode_info,
-- 
1.7.10.4




More information about the sheepdog-users mailing list