Просмотр исходного кода

Ignore memb_join messages during flush operations

a memb_join operation that occurs during flushing can result in an
entry into the GATHER state from the RECOVERY state.  This results in the
regular sort queue being used instead of the recovery sort queue, resulting
in segfault.

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Steven Dake 14 лет назад
Родитель
Сommit
48ffa8892d
1 измененных файлов с 13 добавлено и 0 удалено
  1. 13 0
      exec/totemudp.c

+ 13 - 0
exec/totemudp.c

@@ -89,6 +89,8 @@
 #define BIND_STATE_REGULAR	1
 #define BIND_STATE_LOOPBACK	2
 
+#define MESSAGE_TYPE_MCAST	1
+
 #define HMAC_HASH_SIZE 20
 struct security_header {
 	unsigned char hash_digest[HMAC_HASH_SIZE]; /* The hash *MUST* be first in the data structure */
@@ -1097,6 +1099,7 @@ static int net_deliver_fn (
 	int res = 0;
 	unsigned char *msg_offset;
 	unsigned int size_delv;
+	char *message_type;
 
 	if (instance->flushing == 1) {
 		iovec = &instance->totemudp_iov_recv_flush;
@@ -1156,6 +1159,16 @@ static int net_deliver_fn (
 		size_delv = bytes_received;
 	}
 
+	/*
+	 * Drop all non-mcast messages (more specifically join
+	 * messages should be dropped)
+	 */
+	message_type = (char *)msg_offset;
+	if (instance->flushing == 1 && *message_type != MESSAGE_TYPE_MCAST) {
+		iovec->iov_len = FRAME_SIZE_MAX;
+		return (0);
+	}
+	
 	/*
 	 * Handle incoming message
 	 */