[sheepdog] [PATCH 2/2] sheep: don't allow unauthorized node join when the cluster is in wait_for_join

Liu Yuan namei.unix at gmail.com
Sat Jun 2 10:02:20 CEST 2012


From: Liu Yuan <tailai.ly at taobao.com>

This fixes broken cluster_sanity_check()

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/group.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sheep/group.c b/sheep/group.c
index 3381b44..679f120 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -423,8 +423,11 @@ static int cluster_sanity_check(struct sd_node *entries,
 
 	if (sys_stat_wait_format() || sys_stat_shutdown())
 		goto out;
-	/* When the joining node is newly created, we need not check anything. */
-	if (nr_entries == 0)
+	/*
+	 * When the joining node is newly created and we are not waiting for
+	 * join we need not check anything.
+	 */
+	if (nr_entries == 0 && !sys_stat_wait_join())
 		goto out;
 
 	if (ctime != get_cluster_ctime()) {
-- 
1.7.10.2




More information about the sheepdog mailing list