From: alebre <al...@us...> - 2010-11-25 18:55:45
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "UNNAMED PROJECT". The branch, master has been updated via 5f7ab1e90999db1fd5a35bfdd55c619e0ac8bdf6 (commit) via 305f637c323aadc73d659df7dc6a01bce19a4806 (commit) via 25bd02ce956edb10c9bc63307d41e5df87b13d1a (commit) via 55a43f7b96bbb0086392b1d7967619e26fa98f97 (commit) via 37371415f53d37ef83aec6094e34f180013180ca (commit) via b6c8ca8e4344452710a94add535df104faa1ca79 (commit) via ebed94b849c9ad64b66cb9ea5203f4e0c72f89cc (commit) via bbb575785890cf03c5c4045cb9edaf29b6954511 (commit) via 95acb8c947067313340bd0effb25c0bcceb667ab (commit) from 13bc25cdf1c8055f8a94e7113ae2d6f376a566a9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 5f7ab1e90999db1fd5a35bfdd55c619e0ac8bdf6 Author: ad <leb...@fr...> Date: Thu Nov 25 13:32:00 2010 +0000 replace atoi (deprecated) by strtol diff --git a/tools/mkfs_kdfs.c b/tools/mkfs_kdfs.c index 0376dc0..56f5bfb 100644 --- a/tools/mkfs_kdfs.c +++ b/tools/mkfs_kdfs.c @@ -166,8 +166,8 @@ int main(int argc, char* argv[]) strcat(directory_path,".sb"); errno=0; -// root_nodeid = strtol(argv[2],0,10); - root_nodeid = atoi(argv[2]); + root_nodeid = strtol(argv[2],0,10); +// root_nodeid = atoi(argv[2]); if (errno != 0){ fprintf(stderr, "Root node id is wrong or too "\ "large (errno=%d) !\n", errno); commit 305f637c323aadc73d659df7dc6a01bce19a4806 Merge: 13bc25c 25bd02c Author: ad <leb...@fr...> Date: Mon Oct 4 06:13:55 2010 +0000 Merge branch 'master' of git://mirrors.git.kernel.org/cluster/kerrighed/tools commit 25bd02ce956edb10c9bc63307d41e5df87b13d1a Author: Louis Rilling <lou...@ke...> Date: Fri Jul 23 15:50:02 2010 +0200 [KTP] Fix interrupted system call errors in krgltp-smp.sh Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tests/ktp/krgltp-smp.sh.in b/tests/ktp/krgltp-smp.sh.in index d144e8c..377b904 100755 --- a/tests/ktp/krgltp-smp.sh.in +++ b/tests/ktp/krgltp-smp.sh.in @@ -120,19 +120,23 @@ function run_all_instances() { shift - for i in `seq 1 $nr_ps`; do - status_fifo=${STATUS_FIFO}-$i + # Run background jobs in a sub shell to avoid interrupting later shell + # commands with SIGCHLD + ( + for i in `seq 1 $nr_ps`; do + status_fifo=${STATUS_FIFO}-$i - ( ( - check_krgcap - # Run the test in its own pgrp - set -m - $BASETEST/$@ - ) - echo $? > $status_fifo || echo "Could not write status fifo ${status_fifo}!" - ) & - done + ( + check_krgcap + # Run the test in its own pgrp + set -m + $BASETEST/$@ + ) + echo $? > $status_fifo || echo "Could not write status fifo ${status_fifo}!" + ) & + done + ) for i in `seq 1 $nr_ps`; do $check_fun $i commit 55a43f7b96bbb0086392b1d7967619e26fa98f97 Author: Louis Rilling <lou...@ke...> Date: Fri Jul 23 15:48:27 2010 +0200 [KTP] Protect fifo synchronizations from Kerrighed capabilities Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tests/ktp/krgltp-smp.sh.in b/tests/ktp/krgltp-smp.sh.in index d067bf2..d144e8c 100755 --- a/tests/ktp/krgltp-smp.sh.in +++ b/tests/ktp/krgltp-smp.sh.in @@ -211,12 +211,14 @@ function rsingle(){ echo "*** $@ *** SINGLE run" - # Load any background pipe in its own pgrp - set -m - check_krgcap - $BASETEST/$@ || exit 1 - # Restore default behavior in non-interactive shell - set +m + # Add capabilities only in a sub shell, so that status fifos are always + # written to from the same node + ( + # Load any background pipe in its own pgrp + set -m + check_krgcap + $BASETEST/$@ + ) || exit 1 let nbpassed=nbpassed+1 } commit 37371415f53d37ef83aec6094e34f180013180ca Author: Matthieu Fertré <mat...@ke...> Date: Fri Jul 2 16:25:08 2010 +0200 libkrgcb: callbacks must not be interrupted by another signal diff --git a/libs/libkrgcb/libkrgcb.c b/libs/libkrgcb/libkrgcb.c index 0632a96..717cd16 100755 --- a/libs/libkrgcb/libkrgcb.c +++ b/libs/libkrgcb/libkrgcb.c @@ -420,7 +420,7 @@ static int initialize_signal_handlers(void) sa.sa_handler = handle_signal; sa.sa_flags = 0; - sigemptyset(&sa.sa_mask); + sigfillset(&sa.sa_mask); r = sigaction(SIG_CB_RUN_CHKPT, &sa, NULL); if (r) commit b6c8ca8e4344452710a94add535df104faa1ca79 Author: Matthieu Fertré <mat...@ke...> Date: Thu Jul 1 14:54:49 2010 +0200 [JANITOR] Try to have usable messages for kerrighed-host script Do not print the different steps. Starting stops with a dedicated error message as soon as one step has failed. diff --git a/tools-host/kerrighed-host.init b/tools-host/kerrighed-host.init index a814558..b33c751 100755 --- a/tools-host/kerrighed-host.init +++ b/tools-host/kerrighed-host.init @@ -52,49 +52,34 @@ d_start_container() { # Function that starts the daemon/service. # d_start() { - log_progress_msg "isolate_uts" - if ! d_set_isolate_ns "$ISOLATE_UTS" isolate_uts; then - log_progress_msg "(failed)"; STATUS=1 - fi + d_set_isolate_ns "$ISOLATE_UTS" isolate_uts || return 1 - log_progress_msg "isolate_mnt" - if ! d_set_isolate_ns "$ISOLATE_MNT" isolate_mnt; then - log_progress_msg "(failed)"; STATUS=1 - fi + d_set_isolate_ns "$ISOLATE_MNT" isolate_mnt || return 1 - log_progress_msg "isolate_net" - if ! d_set_isolate_ns "$ISOLATE_NET" isolate_net; then - log_progress_msg "(failed)"; STATUS=1 - fi + d_set_isolate_ns "$ISOLATE_NET" isolate_net || return 1 - log_progress_msg "isolate_user" - if ! d_set_isolate_ns "$ISOLATE_USER" isolate_user; then - log_progress_msg "(failed)"; STATUS=1 - fi + d_set_isolate_ns "$ISOLATE_USER" isolate_user || return 1 - log_progress_msg "cluster_init" if ! echo -n $CLUSTER_INIT_HELPER > /sys/kerrighed/hotplug/cluster_init_helper; then - log_progress_msg "(failed)"; STATUS=1 + log_failure_msg "cluster_init" + return 1 fi - log_progress_msg "net_devices" for dev in $NET_DEVICES; do - log_progress_msg "$dev" if ! echo $dev > /sys/kerrighed/net_devices; then - log_progress_msg "(failed)"; STATUS=1 + log_failure_msg "setup of $dev"; + return 1 fi done if test "$(cat /sys/kerrighed/node_id)" = "$BOOT_ID"; then - log_progress_msg "container" - if [ "$STATUS" = "1" ]; then - log_progress_msg "not starting due to previous errors" - elif ! d_start_container; then - log_progress_msg "(failed)"; STATUS=1 + if ! d_start_container; then + log_failure_msg "start of the container"; + return 1 fi fi - return ${STATUS:-0} + return 0 } d_set_isolate_ns() { @@ -108,7 +93,7 @@ d_set_isolate_ns() { x) ;; *) - log_progress_msg "value of ISOLATE_xxx in $CFG must be either 'true' or 'false'" + log_failure_msg "value of ISOLATE_xxx in $CFG must be either 'true' or 'false'" STATUS=1 ;; esac @@ -144,8 +129,7 @@ else case "$1" in start) log_daemon_msg "Starting $DESC" - d_start || log_end_msg 1 - log_end_msg 0 + d_start && log_progress_msg "done" && log_end_msg 0 ;; stop) log_daemon_msg "Stopping $DESC" commit ebed94b849c9ad64b66cb9ea5203f4e0c72f89cc Author: Louis Rilling <lou...@ke...> Date: Fri Jul 23 15:51:15 2010 +0200 [BUGFIX] [KTP] ipcshm_tool: Fix and cleanup message size handling And fix segmentation faults happening with cr_ipc_shm01 and probably others. shm_size was not correctly computed for WRITE, WRITE_FROM_FILE, and READ operations. Signed-off-by: Louis Rilling <lou...@ke...> diff --git a/tests/apps/ipcshm-tool.c b/tests/apps/ipcshm-tool.c index ddded4f..fffffaa 100644 --- a/tests/apps/ipcshm-tool.c +++ b/tests/apps/ipcshm-tool.c @@ -64,12 +64,28 @@ int create_shm(const char* path) return shmid; } +int get_shm_size(int shmid) +{ + struct shmid_ds buf; + int r; + + r = shmctl(shmid, IPC_STAT, &buf); + if (r) { + fprintf(stderr, "get_shm_size(%d)::shmctl: %s\n", shmid, + strerror(errno)); + return r; + } + + shm_size = buf.shm_segsz; + + return 0; +} + /* return -1 in case of error */ int get_shm(const char* path) { key_t key; - struct shmid_ds buf; - int shmid = -1, r; + int shmid = -1; key = get_key(path); if (key == -1) @@ -82,14 +98,6 @@ int get_shm(const char* path) return shmid; } - r = shmctl(shmid, IPC_STAT, &buf); - if (r) { - fprintf(stderr, "get_shm(%s)::shmctl: %s\n", path, - strerror(errno)); - return r; - } - shm_size = buf.shm_segsz; - return shmid; } @@ -155,7 +163,6 @@ void parse_args(int argc, char *argv[]) break; case 'c': action = CREATE; - shm_size = strlen(optarg)+1; msg = optarg; break; case 'C': @@ -203,6 +210,7 @@ void print_msg(const char *format, ...) int main(int argc, char* argv[]) { int shmid, r; + size_t msg_size = 0; /* Quiet gcc */ char *data; if (argc < 3) { @@ -217,6 +225,29 @@ int main(int argc, char* argv[]) exit(EXIT_FAILURE); } + /* Compute msg_size */ + switch (action) { + case CREATE: + case WRITE: + msg_size = strlen(msg) + 1; + break; + case CREATE_FROM_FILE: + case WRITE_FROM_FILE: { + struct stat buf; + + r = stat(path_msg, &buf); + if (r) { + perror("stat"); + exit(EXIT_FAILURE); + } + msg_size = buf.st_size; + print_msg("size: %zd\n", msg_size); + break; + } default: + /* READ: the whole shm is read */ + break; + } + if (action == CREATE || action == CREATE_FROM_FILE) { if (use_id) { @@ -224,20 +255,7 @@ int main(int argc, char* argv[]) exit(EXIT_FAILURE); } - if (action == CREATE) - shm_size = strlen(msg) + 1; - else { - /* CREATE_FROM_FILE */ - struct stat buf; - r = stat(path_msg, &buf); - if (r) { - perror("stat"); - exit(EXIT_FAILURE); - } - shm_size = buf.st_size; - print_msg("size: %zd\n", shm_size); - } - + shm_size = msg_size; shmid = create_shm(argv[argc-1]); } else if (use_id) { @@ -262,8 +280,17 @@ int main(int argc, char* argv[]) exit(EXIT_FAILURE); } + /* Truncate too long messages */ + if (action == WRITE || action == WRITE_FROM_FILE) { + r = get_shm_size(shmid); + if (r) + exit(EXIT_FAILURE); + if (msg_size > shm_size) + msg_size = shm_size; + } + if (action == CREATE || action == WRITE) { - memcpy(data, msg, shm_size); + memcpy(data, msg, msg_size); print_msg("%d:%s\n", shmid, msg); } else if (action == CREATE_FROM_FILE || action == WRITE_FROM_FILE) { r = open(path_msg, O_RDONLY); @@ -272,15 +299,15 @@ int main(int argc, char* argv[]) exit(EXIT_FAILURE); } - msg = mmap(NULL, shm_size, PROT_READ, MAP_PRIVATE, r, 0); + msg = mmap(NULL, msg_size, PROT_READ, MAP_PRIVATE, r, 0); if (msg == MAP_FAILED) { perror("mmap"); exit(EXIT_FAILURE); } - memcpy(data, msg, shm_size); + memcpy(data, msg, msg_size); - munmap(msg, shm_size); + munmap(msg, msg_size); close(r); @@ -289,6 +316,10 @@ int main(int argc, char* argv[]) /* action == READ */ int i; + r = get_shm_size(shmid); + if (r) + exit(EXIT_FAILURE); + for (i = 0; i < nb_loops; i++) { int n = 0; commit bbb575785890cf03c5c4045cb9edaf29b6954511 Author: Jean Parpaillon <jea...@ke...> Date: Thu Aug 12 17:57:38 2010 +0200 Fix kerrighed.py methods for adding and removing nodes diff --git a/libs/kerrighed.py b/libs/kerrighed.py index 346f051..b6b5920 100644 --- a/libs/kerrighed.py +++ b/libs/kerrighed.py @@ -294,9 +294,9 @@ def krg_cluster_reboot(subclusterid=0): def krg_nodes_add(node_set): """ """ - libkerrighed.krg_nodes_add(node_set) + libkerrighed.krg_nodes_add(node_set.c) def krg_nodes_remove(node_set): """ """ - libkerrighed.krg_nodes_remove(node_set) + libkerrighed.krg_nodes_remove(node_set.c) commit 95acb8c947067313340bd0effb25c0bcceb667ab Author: Jean Parpaillon <jea...@ke...> Date: Fri Jul 16 14:01:08 2010 +0200 Replace failure by warning when kerrighed init script is not run from a Kerrighed container diff --git a/tools/kerrighed.init b/tools/kerrighed.init index a655f93..6f31af2 100755 --- a/tools/kerrighed.init +++ b/tools/kerrighed.init @@ -110,8 +110,8 @@ d_status() { } if ! d_check_kerrighed; then - log_failure_msg "Must be run inside Kerrighed container" - STATUS=1 + log_warning_msg "Must be run inside Kerrighed container" + STATUS=0 else case "$1" in start) ----------------------------------------------------------------------- Summary of changes: libs/kerrighed.py | 4 +- libs/libkrgcb/libkrgcb.c | 2 +- tests/apps/ipcshm-tool.c | 89 +++++++++++++++++++++++++++------------- tests/ktp/krgltp-smp.sh.in | 40 ++++++++++-------- tools-host/kerrighed-host.init | 44 ++++++------------- tools/kerrighed.init | 4 +- tools/mkfs_kdfs.c | 4 +- 7 files changed, 104 insertions(+), 83 deletions(-) hooks/post-receive -- UNNAMED PROJECT |