소스 검색

defect 828
assert in totemsrp_avail occurs with certain test cases. The code was rounding
down to zero when calculating the number of messages required. This patch adds
one in all cases so no roundoff occurs.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@807 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 20 년 전
부모
커밋
21199e23cc
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      exec/totempg.c

+ 8 - 1
exec/totempg.c

@@ -641,8 +641,15 @@ int totempg_send_ok (
 	int total;
 
 	avail = totemmrp_avail ();
+	
+	/*
+	 * msg size less then totempg_totem_config->net_mtu - 25 will take up
+	 * a full message, so add +1
+	 * totempg_totem_config->net_mtu - 25 is for the totempg_mcast header
+	 */
+
 
-	total = (msg_size / (totempg_totem_config->net_mtu - 25) /* for totempg_mcat header */);
+	total = (msg_size / (totempg_totem_config->net_mtu - 25)) + 1; 
 
 	return (avail >= total);
 }