Under extremely rare circumstances when an iovector element of length 0
is sent in the totempg_mcast function the delivery of totem messages
from the fragmentation layer looses a message. This occurs when the
entire totemsrp message area is filled up by one message and the last
iovector in the element list's length is zero.
This patch fixes the problem by removing zero length iovector elements
(which are valid inputs to totempg_mcast) from messages.
Regards
-steve
Index: exec/totempg.c
===================================================================
--- exec/totempg.c (revision 1658)
+++ exec/totempg.c (working copy)
@@ -720,14 +720,16 @@
* Multicast a message
*/
static int mcast_msg (
- struct iovec *iovec,
+ struct iovec *iovec_in,
int iov_len,
int guarantee)
{
int res = 0;
struct totempg_mcast mcast;
struct iovec iovecs[3];
+ struct iovec iovec[64];
int i;
+ int dest, src;
int max_packet_size = 0;
int copy_len = 0;
int copy_base = 0;
@@ -736,6 +738,18 @@
pthread_mutex_lock (&mcast_msg_mutex);
totemmrp_new_msg_signal ();
+ /*
+ * Remove zero length iovectors from the list
+ */
+ assert (iov_len < 64);
+ for (dest = 0, src = 0; src < iov_len; src++) {
+ if (iovec_in[src].iov_len) {
+ memcpy (&iovec[dest++], &iovec_in[src],
+ sizeof (struct iovec));
+ }
+ }
+ iov_len = dest;
+
max_packet_size = TOTEMPG_PACKET_SIZE -
(sizeof (unsigned short) * (mcast_packed_msg_count + 1));
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais