[sheepdog] [PATCH 1/2] Revert "sheep: remove invalid usage of current_vnode_info"

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


This reverts commit b82632b47978315a50e9ba0bbad59f56453f63f5.

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 d4e5cc9..e37b198 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -652,7 +652,7 @@ static void update_cluster_info(const struct cluster_info *cinfo,
 		sockfd_cache_add_group(nroot);
 	sockfd_cache_add(&joined->nid);
 
-	old_vnode_info = get_vnode_info();
+	old_vnode_info = main_thread_get(current_vnode_info);
 	main_thread_set(current_vnode_info, alloc_vnode_info(nroot));
 
 	get_vdis(nroot, joined);
@@ -932,7 +932,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(nroot));
 	if (sys->cinfo.status == SD_STATUS_OK) {
 		ret = inc_and_log_epoch();
@@ -961,7 +961,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, alloc_vnode_info(&old->nroot));
-- 
1.7.10.4




More information about the sheepdog mailing list