From redhat-linux-cluster Fri Jan 05 10:11:27 2007 From: Simone Gotti Date: Fri, 05 Jan 2007 10:11:27 +0000 To: redhat-linux-cluster Subject: [Linux-cluster] [PATCH] wrong strings in quorum disk registration. Message-Id: <1167991887.3079.13.camel () localhost> X-MARC-Message: https://marc.info/?l=redhat-linux-cluster&m=116799190710551 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--=-ep4XbwFepABCn3WX4zR6" --=-ep4XbwFepABCn3WX4zR6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi all, on the openais based cman-2.0.35-2.el5 the output of "cman_tool nodes" or "clustat" provides a wrong quorum device name: [root@nodo01 ~]# cman_tool nodes Node Sts Inc Joined Name 0 X 0 /dev/sdb1�� 1 M 4 2007-01-05 13:03:18 nodo01 2 X 0 nodo02 [root@nodo01 ~]# clustat /dev/sdb1�� not found realloc 924 Member Status: Quorate Member Name ID Status ------ ---- ---- ------ nodo01 1 Online, Local nodo02 2 Offline /dev/sdb1�� 0 Online, Estranged Looking at the code look like the call to info_call in cman_register_quorum_device passed a too small by one "inlen" argument missing the ending \0 of the device name string. I attached a patch the should fix this, I hope it's correct. Thanks! Bye! -- Simone Gotti -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Cassine di Pietra: una varietà completa di vini del Veneto, * in più un regalo per il primo ordine! Clicca subito qui * Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3925&d=5-1 --=-ep4XbwFepABCn3WX4zR6 Content-Disposition: attachment; filename*0=cman-2.0.35-libcman-cman_register_quorum_device-info_call.pat; filename*1=ch Content-Type: text/x-patch; name=cman-2.0.35-libcman-cman_register_quorum_device-info_call.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit diff -r -u -p cman-2.0.35.orig/cman/lib/libcman.c cman-2.0.35/cman/lib/libcman.c --- cman-2.0.35.orig/cman/lib/libcman.c 2006-10-25 14:23:46.000000000 +0200 +++ cman-2.0.35/cman/lib/libcman.c 2007-01-05 13:13:53.000000000 +0100 @@ -1002,7 +1002,7 @@ int cman_register_quorum_device(cman_han memcpy(buf, &votes, sizeof(int)); strcpy(buf+sizeof(int), name); - return info_call(h, CMAN_CMD_REG_QUORUMDEV, buf, strlen(name)+sizeof(int), NULL, 0); + return info_call(h, CMAN_CMD_REG_QUORUMDEV, buf, strlen(name)+1+sizeof(int), NULL, 0); } int cman_unregister_quorum_device(cman_handle_t handle) --=-ep4XbwFepABCn3WX4zR6 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- Linux-cluster mailing list Linux-cluster@redhat.com https://www.redhat.com/mailman/listinfo/linux-cluster --=-ep4XbwFepABCn3WX4zR6--