From 9dc35c2df861769eff794daca0bf60b33363007b Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Wed, 22 May 2013 03:23:08 +0000 Subject: [PATCH 1/3] - reduce ocfs2_controld priority to RR(1). (bnc#804707) + bnc804707-reduce-RR-priority.patch - Fix the race between udev making misc device node and ocfs2 opening that device (bnc#805764) + bug-805764-ocfs2-controld.patch - ocfs2_controld: ocfs2_controld-pacemaker.diff -- changes to be compatible with pacemaker >= 1.1.8 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/ocfs2-tools?expand=0&rev=55 --- bnc804707-reduce-RR-priority.patch | 13 +++++ bug-805764-ocfs2-controld.patch | 84 ++++++++++++++++++++++++++++++ ocfs2-tools.changes | 11 ++++ ocfs2-tools.spec | 4 ++ ocfs2_controld-pacemaker.diff | 59 ++++++++++++++++++--- 5 files changed, 165 insertions(+), 6 deletions(-) create mode 100644 bnc804707-reduce-RR-priority.patch create mode 100644 bug-805764-ocfs2-controld.patch diff --git a/bnc804707-reduce-RR-priority.patch b/bnc804707-reduce-RR-priority.patch new file mode 100644 index 0000000..fee21b2 --- /dev/null +++ b/bnc804707-reduce-RR-priority.patch @@ -0,0 +1,13 @@ +Index: ocfs2-tools/ocfs2_controld/main.c +=================================================================== +--- ocfs2-tools.orig/ocfs2_controld/main.c ++++ ocfs2-tools/ocfs2_controld/main.c +@@ -1233,7 +1233,7 @@ static void set_scheduler(void) + struct sched_param sched_param; + int rv; + +- rv = sched_get_priority_max(SCHED_RR); ++ rv = sched_get_priority_min(SCHED_RR); + if (rv != -1) { + sched_param.sched_priority = rv; + rv = sched_setscheduler(0, SCHED_RR, &sched_param); diff --git a/bug-805764-ocfs2-controld.patch b/bug-805764-ocfs2-controld.patch new file mode 100644 index 0000000..f086a24 --- /dev/null +++ b/bug-805764-ocfs2-controld.patch @@ -0,0 +1,84 @@ +Index: ocfs2-tools/ocfs2_controld/main.c +=================================================================== +--- ocfs2-tools.orig/ocfs2_controld/main.c ++++ ocfs2-tools/ocfs2_controld/main.c +@@ -948,6 +948,68 @@ static void cpg_joined(int first) + } + } + ++static int find_minors(void) ++{ ++ FILE *fl; ++ char name[256]; ++ uint32_t number; ++ int c; ++ int control_minor = 0; ++ ++ if (!(fl = fopen("/proc/misc", "r"))) { ++ log_error("failed to open /proc/misc: %s", strerror(errno)); ++ goto out; ++ } ++ ++ while (!feof(fl)) { ++ if (fscanf(fl, "%d %255s\n", &number, &name[0]) == 2) { ++ if (!strcmp(name, "ocfs2_control")) ++ control_minor = number; ++ } else do { ++ c = fgetc(fl); ++ } while (c != EOF && c != '\n'); ++ ++ if (control_minor) ++ break; ++ } ++ fclose(fl); ++ ++ if (!control_minor) ++ log_error("Is ocfs2 missing from kernel? No misc devices found"); ++out: ++ return control_minor; ++} ++ ++static int find_udev_device(const char *path, uint32_t minor) ++{ ++ struct stat st; ++ int i; ++ ++ for (i = 0; i < 10; i++) { ++ if (stat(path, &st) == 0 && minor(st.st_rdev) == minor) ++ return 0; ++ sleep(1); ++ } ++ ++ log_error("cannot find device %s with minor %d", path, minor); ++ return -1; ++} ++ ++static int setup_misc_device(void) ++{ ++ int rv = -1; ++ int control_minor = find_minors(); ++ ++ if (control_minor) { ++ rv = find_udev_device("/dev/misc/ocfs2_control", control_minor); ++ if (rv < 0) ++ return rv; ++ log_debug("found /dev/misc/ocfs2_control %u", control_minor); ++ } ++ ++ return rv; ++} ++ + static int loop(void) + { + int rv, i, poll_timeout = -1; +@@ -968,6 +1030,10 @@ static int loop(void) + if (rv < 0) + goto out; + ++ rv = setup_misc_device(); ++ if (rv < 0) ++ goto out; ++ + rv = setup_cpg(cpg_joined); + if (rv < 0) + goto out; diff --git a/ocfs2-tools.changes b/ocfs2-tools.changes index 0c82825..41412a7 100644 --- a/ocfs2-tools.changes +++ b/ocfs2-tools.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Wed May 22 03:04:22 UTC 2013 - tserong@suse.com + +- reduce ocfs2_controld priority to RR(1). (bnc#804707) + + bnc804707-reduce-RR-priority.patch +- Fix the race between udev making misc device node and ocfs2 + opening that device (bnc#805764) + + bug-805764-ocfs2-controld.patch +- ocfs2_controld: ocfs2_controld-pacemaker.diff -- changes to be + compatible with pacemaker >= 1.1.8 + ------------------------------------------------------------------- Sat Apr 13 11:57:30 UTC 2013 - schwab@suse.de diff --git a/ocfs2-tools.spec b/ocfs2-tools.spec index 27e9d15..d29933f 100644 --- a/ocfs2-tools.spec +++ b/ocfs2-tools.spec @@ -42,6 +42,8 @@ Patch207: fix-indexed-dirs.patch Patch208: 0001-fswreck-Create-a-loop-in-group-chains.patch Patch209: 0002-Break-a-chain-loop-in-group-desc.patch Patch210: restore-g_list_append.patch +Patch212: bug-805764-ocfs2-controld.patch +Patch213: bnc804707-reduce-RR-priority.patch BuildRequires: autoconf BuildRequires: e2fsprogs-devel BuildRequires: libaio-devel @@ -137,6 +139,8 @@ managing the file system. %patch208 -p1 %patch209 -p1 %patch210 -p1 +%patch212 -p1 +%patch213 -p1 %build export PROJECT="ocfs2-tools" diff --git a/ocfs2_controld-pacemaker.diff b/ocfs2_controld-pacemaker.diff index 99632fa..4701ba7 100644 --- a/ocfs2_controld-pacemaker.diff +++ b/ocfs2_controld-pacemaker.diff @@ -1,13 +1,60 @@ Index: ocfs2-tools/ocfs2_controld/pacemaker.c =================================================================== ---- ocfs2-tools.orig/ocfs2_controld/pacemaker.c 2012-08-24 10:17:33.000000000 -0500 -+++ ocfs2-tools/ocfs2_controld/pacemaker.c 2012-08-24 10:19:13.000000000 -0500 -@@ -30,7 +30,7 @@ +--- ocfs2-tools.orig/ocfs2_controld/pacemaker.c 2012-08-24 10:02:19.000000000 -0500 ++++ ocfs2-tools/ocfs2_controld/pacemaker.c 2012-11-26 16:16:38.000000000 -0600 +@@ -28,9 +28,8 @@ + #define SUPPORT_HEARTBEAT 0 + #include - #include - #include +-#include +-#include -#include -+#include ++#include ++#include #include #include +@@ -47,6 +46,7 @@ static char * clustername = "pacemaker" + extern struct list_head mounts; + const char *stackname = "pcmk"; + ++static crm_cluster_t crm_cluster; + extern int ais_fd_async; + char *local_node_uname = NULL; + +@@ -138,28 +138,29 @@ static void dead_pcmk(int ci) + connection_dead(ci); + } + +-extern void terminate_ais_connection(void); +- + void exit_stack(void) + { + log_debug("closing pacemaker connection"); +- terminate_ais_connection(); ++ crm_cluster_disconnect(&crm_cluster); + } + + static void process_pcmk(int ci) + { +- ais_dispatch(ais_fd_async, NULL); ++ ais_dispatch(NULL); + } + + int setup_stack(void) + { +- crm_log_init("ocfs2_controld", LOG_INFO, FALSE, TRUE, 0, NULL); ++ crm_log_init("ocfs2_controld", LOG_INFO, FALSE, TRUE, 0, NULL, FALSE); + +- if(init_ais_connection(NULL, NULL, NULL, &local_node_uname, &our_nodeid) == FALSE) { ++ if(crm_cluster_connect(&crm_cluster) == FALSE) { + log_error("Connection to our AIS plugin (CRM) failed"); + return -1; + } + ++ local_node_uname = crm_cluster.uname; ++ our_nodeid = crm_cluster.nodeid; ++ + /* Sign up for membership updates */ + send_ais_text(crm_class_notify, "true", TRUE, NULL, crm_msg_ais); + From ed5627189617bc196be60ef7b4789d268fa03489 Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Mon, 27 May 2013 08:13:31 +0000 Subject: [PATCH 2/3] - Replace NAME= with SYMLINK+= in udev rules (bnc#779718) + use-symlink-in-udev-rules.patch OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/ocfs2-tools?expand=0&rev=56 --- ocfs2-tools.changes | 6 ++++++ ocfs2-tools.spec | 2 ++ use-symlink-in-udev-rules.patch | 8 ++++++++ 3 files changed, 16 insertions(+) create mode 100644 use-symlink-in-udev-rules.patch diff --git a/ocfs2-tools.changes b/ocfs2-tools.changes index 41412a7..3ff5250 100644 --- a/ocfs2-tools.changes +++ b/ocfs2-tools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon May 27 08:14:45 UTC 2013 - tserong@suse.com + +- Replace NAME= with SYMLINK+= in udev rules (bnc#779718) + + use-symlink-in-udev-rules.patch + ------------------------------------------------------------------- Wed May 22 03:04:22 UTC 2013 - tserong@suse.com diff --git a/ocfs2-tools.spec b/ocfs2-tools.spec index d29933f..5a7cda4 100644 --- a/ocfs2-tools.spec +++ b/ocfs2-tools.spec @@ -44,6 +44,7 @@ Patch209: 0002-Break-a-chain-loop-in-group-desc.patch Patch210: restore-g_list_append.patch Patch212: bug-805764-ocfs2-controld.patch Patch213: bnc804707-reduce-RR-priority.patch +Patch214: use-symlink-in-udev-rules.patch BuildRequires: autoconf BuildRequires: e2fsprogs-devel BuildRequires: libaio-devel @@ -141,6 +142,7 @@ managing the file system. %patch210 -p1 %patch212 -p1 %patch213 -p1 +%patch214 -p1 %build export PROJECT="ocfs2-tools" diff --git a/use-symlink-in-udev-rules.patch b/use-symlink-in-udev-rules.patch new file mode 100644 index 0000000..6cba6cf --- /dev/null +++ b/use-symlink-in-udev-rules.patch @@ -0,0 +1,8 @@ +Index: ocfs2-tools-1.8.2+git.1361836695.ff84eb5/vendor/common/51-ocfs2.rules +=================================================================== +--- ocfs2-tools-1.8.2+git.1361836695.ff84eb5.orig/vendor/common/51-ocfs2.rules ++++ ocfs2-tools-1.8.2+git.1361836695.ff84eb5/vendor/common/51-ocfs2.rules +@@ -1,2 +1,2 @@ +-KERNEL=="ocfs2_control", NAME="misc/ocfs2_control", MODE="0660" ++KERNEL=="ocfs2_control", SYMLINK+="misc/ocfs2_control", MODE="0660" + From d309aba9b2feecf7e2f88f0dbaf60df195a47214 Mon Sep 17 00:00:00 2001 From: Goldwyn Rodrigues Date: Wed, 3 Jul 2013 13:54:07 +0000 Subject: [PATCH 3/3] Accepting request 181861 from home:goldwynr:branches:network:ha-clustering:Factory bnc#827504 OBS-URL: https://build.opensuse.org/request/show/181861 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/ocfs2-tools?expand=0&rev=57 --- ocfs2-tools.changes | 5 +++++ ocfs2-tools.spec | 2 ++ ocfs2console-libraries-include-aio.patch | 13 +++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 ocfs2console-libraries-include-aio.patch diff --git a/ocfs2-tools.changes b/ocfs2-tools.changes index 3ff5250..798dc46 100644 --- a/ocfs2-tools.changes +++ b/ocfs2-tools.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jul 3 07:40:31 CDT 2013 - rgoldwyn@suse.com +- ocfs2console-libraries-include-aio.patch: Include aio + while compiling ocfs2console (bnc#827504) + ------------------------------------------------------------------- Mon May 27 08:14:45 UTC 2013 - tserong@suse.com diff --git a/ocfs2-tools.spec b/ocfs2-tools.spec index 5a7cda4..7a59bcc 100644 --- a/ocfs2-tools.spec +++ b/ocfs2-tools.spec @@ -45,6 +45,7 @@ Patch210: restore-g_list_append.patch Patch212: bug-805764-ocfs2-controld.patch Patch213: bnc804707-reduce-RR-priority.patch Patch214: use-symlink-in-udev-rules.patch +Patch215: ocfs2console-libraries-include-aio.patch BuildRequires: autoconf BuildRequires: e2fsprogs-devel BuildRequires: libaio-devel @@ -143,6 +144,7 @@ managing the file system. %patch212 -p1 %patch213 -p1 %patch214 -p1 +%patch215 -p1 %build export PROJECT="ocfs2-tools" diff --git a/ocfs2console-libraries-include-aio.patch b/ocfs2console-libraries-include-aio.patch new file mode 100644 index 0000000..5810203 --- /dev/null +++ b/ocfs2console-libraries-include-aio.patch @@ -0,0 +1,13 @@ +Index: ocfs2-tools/ocfs2console/ocfs2interface/Makefile +=================================================================== +--- ocfs2-tools.orig/ocfs2console/ocfs2interface/Makefile 2012-08-24 10:02:19.000000000 -0500 ++++ ocfs2-tools/ocfs2console/ocfs2interface/Makefile 2013-04-24 12:06:35.115649501 -0500 +@@ -8,7 +8,7 @@ CFLAGS += -fPIC + + PYMOD_CFLAGS = -fno-strict-aliasing $(PYTHON_INCLUDES) + +-LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2 ++LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2 -laio + LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a + + LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)