[sheepdog] [PATCH 1/2] fix sheep crash when executing functional test 009

Ruoyu liangry at ucweb.com
Mon Aug 11 12:11:43 CEST 2014


No participant should be permitted. In the situation, just return
is OKay in function del_participant.

Signed-off-by: Ruoyu <liangry at ucweb.com>
---
 sheep/vdi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sheep/vdi.c b/sheep/vdi.c
index 9db38c4..05cae7b 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -390,7 +390,8 @@ static void del_participant(struct vdi_state_entry *entry,
 {
 	int idx = -1;
 
-	assert(0 < entry->nr_participants);
+	if (entry->nr_participants == 0)
+		return;
 
 	for (int i = 0; i < entry->nr_participants; i++) {
 		if (!node_id_cmp(&entry->participants[i], owner)) {
-- 
1.8.3.2




More information about the sheepdog mailing list