[sheepdog] [PATCH] sheep: check unknown join result in sd_join_handler()

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Mon Feb 18 10:02:02 CET 2013


sd_join_handler() does nothing even if a join result is unknown
value. The unknown value means sd_check_join_cb() is buggy, so
after receiving such a value sheep should print error message and die.

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

diff --git a/sheep/group.c b/sheep/group.c
index 85e0032..63beb29 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -1085,6 +1085,12 @@ void sd_join_handler(const struct sd_node *joined,
 			/* this output is used for testing */
 			sd_printf(SDOG_DEBUG, "join Sheepdog cluster\n");
 		break;
+	default:
+		/* this means sd_check_join_cb() is buggy */
+		sd_printf(SDOG_CRIT, "unknown cluster join result: %d\n",
+			result);
+		abort();
+		break;
 	}
 }
 
-- 
1.7.2.5




More information about the sheepdog mailing list