Commit Graph

2844 Commits

Author SHA1 Message Date
Masatake YAMATO
7ba892dac3 fix typos in cpg_mcast_joined.3 and cpg_zcb_mcast_joined.3
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2011-06-29 09:12:31 -07:00
Steven Dake
899052484e Add coverity target to corosync makefile.am
Allow a make coverity target for those developers with coverity tools
available to them.

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2011-06-29 09:11:42 -07:00
Jan Friesse
94d934e0e0 coroipcc: Test _SC_PAGESIZE result
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-29 15:17:49 +02:00
Jan Friesse
8c717c22b2 Remove spinlocks
Spinlocks are now removed, because even spinlock can improve
speed is some special cases, in most cases it makes corosync CPU usage
much more intensive and less responsive then if only mutexes are used.

What we were doing is:
pthread_mutex_lock
pthread_spin_lock
pthread_spin_unlock
pthread_mutex_unlock

what is not safe.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-29 12:01:54 +02:00
Jan Friesse
5458d4f27a votequorum: free newly allocated node if nodeid==0
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-29 11:59:57 +02:00
Jerome Flesch
00434a4f10 Fix usage of strerror_r()/perror()
Signed-off-by: Jerome Flesch <jerome.flesch@netasq.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2011-06-28 09:56:58 +02:00
Steven Dake
ae4a3af340 sched_params log message incorrect
The sched_params parameter was set before being printed.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Reviewed-by:  <sdake@redhat.com>
2011-06-22 22:46:56 -07:00
Jan Friesse
424200d962 configure.ac: Align --enable-* options description
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-22 11:29:39 +02:00
Jan Friesse
5a6a8a0c9e configure.ac: change edefault to default
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-22 11:25:08 +02:00
Jan Friesse
ae2ac5945b CTS: Test for confdb dispatch deadlock
Test is disabled by default because it depends on SMP and about 2GB RAM.
It's also testing race, so test is unreliable.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-22 11:21:01 +02:00
Jan Friesse
b5d2f4578a confdb: Resolve dispatch deadlock
Following situation could happen:
- one thread is waiting for finish write operation (line 853), objdb is
  locked
- flush (done in objdb_notify_dispatch) is called in main thread, but
  this call will never appear because main thread is waiting for objdb
  lock.

In this situation deadlock appears.

Commit solves this by:
- setting pipe to non-blocking mode
- pipe is used only as trigger for coropoll
- dispatch messages are stored in list
- main thread is processing messages from list

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-22 11:20:55 +02:00
Jan Friesse
e8000c7b9b objdb: save copy of handles in object_find_create
Following situation could happen:
- process 1 thru confdb creates find handle
- calls find iteration once
- different process 2 deletes object pointed by process 1 iterator
- process 1 calls iteration again ->
  object_find_instance->find_child_list is invalid pointer

-> segfault

Now object_find_create creates array of matching object handlers and
object_find_next uses that array together with check for name. This
prevents situation where between steps 2 and 3 new object is created
with different name but sadly with same handle.

Also good to note that this patch is more or less quick hack rather
then proper solution. Real proper solution is to not use pointers
and rather use handles everywhere. This is big TODO.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-22 11:13:12 +02:00
Jiaju Zhang
c6bfc6b5d6 RRP: Fix ring initialization issue for UDPU mode
Redundant ring has some problem in the UDP unicast mode. The problem
is the second ring has not been successfully initialized, that is, the
second time iface_changes happens, the member list for that interface
has not been added, which results in that ring cannot transmit normal
message. So the second ring cannot take over the work if the first
ring is down. This patch fixes this issue.

comments from review:
More work is needed probably in totemnet where totemnet maintains the
the of node list and an iterator for them, and totemudpu_member_add adds
state information to a context for the iteration.

In any regard, that is somewhat difficult to test, so I'll merge this
patch for now - keep in mind interface changes on the bindnetaddr will
cause problems with udpu after this patch has been commmitted.

Signed-off-by: Jiaju Zhang <jjzhang@suse.de>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-16 17:23:36 -07:00
Jan Friesse
2e5dc5f322 coroipcc: check recvmsg result in socket_recv
According specification recvmsg can return 0, which means that
connection is closed. We had this check, but limited only for systems
other then Linux. recvmsg can return 0 even on Linux, so check is now
applied on all systems.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2011-06-10 12:33:19 +02:00
Jan Friesse
9afb4bdaa8 confdb: Properly check result of object_find_create
in confdb_object_iter result of object_find_create is now properly
checked. object_find_create can return -1 if object doesn't exists.
Without this check, incorrect handle (memory garbage) was directly
passed to object_find_next.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2011-06-10 12:33:07 +02:00
Jan Friesse
50f05bfa15 crypto: rng_make_prng prevent buf overflow
with bits set to 1023, buf of 256 bytes was filled by rng_get_bytes
up to 257 bytes. Buf is now 258 bytes so it's no longer problem.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-10 12:12:05 +02:00
Jan Friesse
afa0398ca4 mainconfig: Check retval of logsys_format_set
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-06 10:02:34 +02:00
Jan Friesse
aa23d20125 testcpgzc: fgets buffer to really allocated size
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-03 11:11:28 +02:00
Jan Friesse
f95d3b3bf2 cpg: do_proc_join change list_slice to list_add
In this concrete case result is equivalent but makes coverity happy.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-03 11:10:08 +02:00
Jan Friesse
531e81602f totemudp: memset of proper size
In totemudp_mcast_thread_state_constructor memset to
sizeof(struct totemudp_mcast_thread_state) instead of size of
pointer.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-03 11:09:27 +02:00
Jan Friesse
ea0a24866c coroipcs: init buf in coroipcs_handler_dispatch
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-03 11:09:01 +02:00
Jan Friesse
c2a39cb8e2 coroparse: don't leak dirent
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-03 11:00:56 +02:00
Jan Friesse
d76bb76d1f logsys: _logsys_wthread_create never returns != 0
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-03 10:59:17 +02:00
Jan Friesse
844c8759d7 notifyd: Check retval of corosync_cfg_initialize
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-03 10:59:08 +02:00
Jan Friesse
6b9297131c totemconfig: discard check of objdb_get_string ret
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-03 10:58:15 +02:00
Jan Friesse
0273c54054 coroipcc: proper path size in coroipcc_zcb_alloc
memory_map function internally limits maximum path size to
PATH_MAX but coroipcc_zcb_alloc passed smaller buffer.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-03 10:57:42 +02:00
Jan Friesse
6af98e79ee libquorum: memset/memcpy proper size of callbacks
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-03 10:57:18 +02:00
Jan Friesse
77d9808125 iazc: Reduce number of mem alloc and memcpy
X86 processors are able to handle unaligned memory access. Improve
performance by using that feature on i386 and x86_64 compatible
processors, and use old aligning code on different processors.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-05-30 09:06:35 +02:00
Jerome Flesch
6bec0aa227 logsys: When corosync is compiled with --enable-small-memory-footprint, also reduce the size of the logsys SHM
Signed-off-by: Jerome Flesch <jerome.flesch@netasq.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-05-27 13:45:27 +02:00
Jerome Flesch
795aa5e24c coroipcc_dispatch_get(): Fix --enable-small-memory-footprint support
Signed-off-by: Jerome Flesch <jerome.flesch@netasq.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2011-05-27 13:42:42 +02:00
Jerome Flesch
b112672115 coroipcs_handler_dispatch(): Fix conn_info->service security value: -1 is not a good security value since it's equal to SOCKET_SERVICE_INIT
Signed-off-by: Jerome Flesch <jerome.flesch@netasq.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
2011-05-27 13:40:36 +02:00
Jerome Flesch
76426d7901 coroipcc: Fix unhandled BSD EOF in coroipcc_dispatch_get()
Signed-off-by: Jerome Flesch <jerome.flesch@netasq.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-05-27 13:35:02 +02:00
Jerome Flesch
fe51e70367 Corosync: Fix build when done with --enable-fatal-warnings
Signed-off-by: Jerome Flesch <jerome.flesch@netasq.com>
Reviewed-by: Jan Friesse<jfriesse@redhat.com>
2011-05-27 13:29:12 +02:00
Russell Bryant
a53e402912 logsys.c: Use snprintf() instead of sprintf().
Change a couple of string functions to use the the output length
limiting counterpart.

Signed-off-by: Russell Bryant <russell@russellbryant.net>
2011-05-08 02:42:47 -05:00
Jan Friesse
801717e463 corosync-objctl: Option to display binary data
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-05-13 12:01:59 +02:00
Angus Salkeld
956a1dcb42 cpg: fix sync master selection when one node paused.
If one node is paused it can miss a config change and
thus report a larger old_members than expected.

The solution is to use the left_nodes field.

Master selection used to be "choose node with":
1) largest previous membership
2) (then as a tie-breaker) node with smallest nodeid

New selection:
1) largest (previous #nodes - #nodes know to have left)
2) (then as a tie-breaker) node with smallest nodeid

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-05 21:39:30 +10:00
Angus Salkeld
f3387a8287 CTS: fix some tests that didn't handle been called more than one
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-05 21:39:30 +10:00
Angus Salkeld
b1d65a7e8c CTS: sort the configuration - prevent duplicates in the config file
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-05 21:39:30 +10:00
Angus Salkeld
6ed7c36c95 CTS: fix syntax error in log message
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-05 21:39:30 +10:00
Angus Salkeld
fbb53397c3 CTS: bump up log messages of failed RPC
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-05 21:39:30 +10:00
Angus Salkeld
f33ea3be2b CTS: don't force all-once (breaks random tests)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-05 21:39:30 +10:00
Angus Salkeld
1db961d6ad autobuild: improve messages
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-05 21:39:30 +10:00
Angus Salkeld
dc402cbb98 CTS: add -l to keygen (normal keygen struggles to run on VMs)
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-05 21:39:30 +10:00
Angus Salkeld
a22c9afde0 CTS: send with correct number of iovecs
Else payload won't be sent

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-05 21:39:30 +10:00
Angus Salkeld
e4cf620e6f CTS: timer should not be on the stack
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-05 21:39:29 +10:00
Jan Friesse
61d83cd719 totemsrp: Enhance mcast failure detection
memb_state_gather_enter increase stats.continuous_gather only if
previous state was gather also. This should happen only if multicast is
not working properly (local firewall in most cases) and not if many
nodes joins at one time.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2011-05-05 11:00:26 +02:00
Jan Friesse
719fddd8e1 coroipcs: Deny connect to service without initfn
If library connect to service with no init function, coroipcs will try
to dereference NULL pointer. Now we correctly return error code
CS_ERR_NOT_EXIST.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-04-15 08:56:35 +02:00
Tim Serong
5b92829d6c Add ipc_refcnt to message_handler_req_{exec, lib}_cfg_ringreenable()
Without refcounting the conn pointer here, corosync will segfault
if one kills a running instance of "corosync-cfgtool -r" (rhbz#695191)

Signed-off-by: Tim Serong <tserong@novell.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-04-14 20:14:12 -07:00
Steven Dake
6a752ba1b1 Align ipc on 8 byte boundaries
Align all ipc messages on 8 byte boundaries.  This alignment will remove bus
errors on systems that can't access non-byte aligned data and should improve
performance.

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-14 17:25:08 -07:00
Steven Dake
83f528b473 Fix problem where unaligned totemip address access would result in bus error on non-unaligned-safe architectures.
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2011-04-14 17:22:02 -07:00