From 7a792738eb0d84157e2430db7a39f91d8dd2ba4c524eb64e9b0e31423fb94caa Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Thu, 18 Mar 2010 14:42:41 +0000 Subject: [PATCH 1/5] Updating link to change in openSUSE:Factory/dmraid revision 29.0 OBS-URL: https://build.opensuse.org/package/show/Base:System/dmraid?expand=0&rev=d6f79d12de844fe58a1135caeccfdead --- ready | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 ready diff --git a/ready b/ready deleted file mode 100644 index 473a0f4..0000000 From 74e95cfa4f7779b2fd65f39d3eefb97025d800c0e35818ce8685e69fd531c490 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 19 Apr 2010 23:14:46 +0000 Subject: [PATCH 2/5] OBS-URL: https://build.opensuse.org/package/show/Base:System/dmraid?expand=0&rev=14 --- dmraid.changes | 8 ++++++ dmraid.spec | 4 +++ handle_spaces | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++ remove_trylock | 35 ++++++++++++++++++++++++ 4 files changed, 120 insertions(+) create mode 100644 handle_spaces create mode 100644 remove_trylock diff --git a/dmraid.changes b/dmraid.changes index c4e045d..1c0386e 100644 --- a/dmraid.changes +++ b/dmraid.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Apr 19 23:11:39 UTC 2010 - nfbrown@novell.com + +- handle_space: cope with arrays with spaces in the name stored + in the metadata (bnc#470696) +- remove_trylock: pthreads_mutex_trylock is still very new in + glibc so safest not to use it yet (bnc#594388) + ------------------------------------------------------------------- Tue Feb 2 03:46:18 UTC 2010 - nfbrown@novell.com diff --git a/dmraid.spec b/dmraid.spec index ec33cc1..6971bee 100644 --- a/dmraid.spec +++ b/dmraid.spec @@ -38,6 +38,8 @@ Source5: mkinitrd-boot.sh Patch1: dmraid-1.0.0.rc16-cvs-2010-02-02.patch Patch2: dmraid-1.0.0.rc13-geometry.patch Patch3: lib-install.patch +Patch4: handle_spaces +Patch5: remove_trylock BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: %fillup_prereq @@ -72,6 +74,8 @@ Authors: %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 +%patch5 -p2 cp %{SOURCE3} . %build diff --git a/handle_spaces b/handle_spaces new file mode 100644 index 0000000..1348009 --- /dev/null +++ b/handle_spaces @@ -0,0 +1,73 @@ +--- + include/dmraid/misc.h | 1 + + lib/format/ataraid/isw.c | 7 ++++++- + lib/format/ddf/ddf1.c | 1 + + lib/misc/misc.c | 14 ++++++++++++++ + 4 files changed, 22 insertions(+), 1 deletion(-) + +--- 1.0.0.rc16.orig/include/dmraid/misc.h ++++ 1.0.0.rc16/include/dmraid/misc.h +@@ -18,6 +18,7 @@ extern void libdmraid_exit(struct lib_co + + extern void sysfs_workaround(struct lib_context *lc); + extern void mk_alpha(struct lib_context *lc, char *str, size_t len); ++extern void mk_alphanum(struct lib_context *lc, char *str, size_t len); + extern char *get_basename(struct lib_context *lc, char *str); + extern char *get_dirname(struct lib_context *lc, char *str); + extern char *remove_white_space(struct lib_context *lc, char *str, size_t len); +--- 1.0.0.rc16.orig/lib/format/ataraid/isw.c ++++ 1.0.0.rc16/lib/format/ataraid/isw.c +@@ -169,6 +169,7 @@ static size_t + _name(struct lib_context *lc, struct isw *isw, char *str, size_t len, + enum name_type nt, int num, struct isw_dev *dev, struct raid_dev *rd) + { ++ int n; + struct { + const char *fmt, *what; + } formats[] = { +@@ -189,7 +190,11 @@ _name(struct lib_context *lc, struct isw + f += (is_raid10(dev) ? 1 : 0); + } + +- return snprintf(str, len, f->fmt, isw->family_num, f->what, num); ++ n = snprintf(str, len, f->fmt, isw->family_num, f->what, num); ++ /* As '->volume' could contain anything, we need to sanitise the name */ ++ if (str) ++ mk_alphanum(lc, str, n); ++ return n; + } + + static char * +--- 1.0.0.rc16.orig/lib/format/ddf/ddf1.c ++++ 1.0.0.rc16/lib/format/ddf/ddf1.c +@@ -689,6 +689,7 @@ name(struct lib_context *lc, struct ddf1 + i = prefix + 16; + while (!isgraph(buf[--i])); + buf[i + 1] = 0; ++ mk_alphanum(lc, buf, i); + } else { + char *b; + +--- 1.0.0.rc16.orig/lib/misc/misc.c ++++ 1.0.0.rc16/lib/misc/misc.c +@@ -66,6 +66,20 @@ mk_alpha(struct lib_context *lc, char *s + } + } + ++/* Convert a string to only have alphanum or '-' or '_'. ++ * All others become '_' ++ */ ++void ++mk_alphanum(struct lib_context *lc, char *str, size_t len) ++{ ++ for (; len && *str; len--, str++) { ++ if (!isalnum(*str) && ++ *str != '-' && ++ *str != '_') ++ *str = '_'; ++ } ++} ++ + /* Remove any whitespace from a string. */ + char * + remove_white_space(struct lib_context *lc, char *str, size_t size) diff --git a/remove_trylock b/remove_trylock new file mode 100644 index 0000000..f7997eb --- /dev/null +++ b/remove_trylock @@ -0,0 +1,35 @@ +Remove call to pthreads_mutex_trylock + +Reference bnc +594388 +This appears only to be in very recent releases of glibc. +Its presence causes + +/sbin/dmraid -ay -p +The dynamic shared library "libdmraid-events-isw.so" could not be loaded: + /lib/libdmraid-events-isw.so: undefined symbol: pthread_mutex_trylock + +on openSUSE 11.3, it is is not used for anything except a simple +logging message. + +Signed-off-by: NeilBrown + +--- + 1.0.0.rc16/lib/events/libdmraid-events-isw.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +--- dmraid.orig/1.0.0.rc16/lib/events/libdmraid-events-isw.c ++++ dmraid/1.0.0.rc16/lib/events/libdmraid-events-isw.c +@@ -1433,11 +1433,7 @@ void process_event(struct dm_task *dmt, + /* + * Make sure, events are processed sequentially per RAID set. + */ +- if (pthread_mutex_trylock(&rs->event_mutex)) { +- syslog(LOG_NOTICE, +- " Another thread is handling an event. Waiting..."); +- pthread_mutex_lock(&rs->event_mutex); +- } ++ pthread_mutex_lock(&rs->event_mutex); + + do { + next = dm_get_next_target(dmt, next, &start, &length, From cdc2f9118c77cb2f0d2f5b36f365f76d8509adc297c77047ca34dc22312aa8c4 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Fri, 7 May 2010 13:41:53 +0000 Subject: [PATCH 3/5] Accepting request 39527 from Base:System checked in (request 39527) OBS-URL: https://build.opensuse.org/request/show/39527 OBS-URL: https://build.opensuse.org/package/show/Base:System/dmraid?expand=0&rev=15 --- dmraid.changes | 8 ------ dmraid.spec | 4 --- handle_spaces | 73 -------------------------------------------------- remove_trylock | 35 ------------------------ 4 files changed, 120 deletions(-) delete mode 100644 handle_spaces delete mode 100644 remove_trylock diff --git a/dmraid.changes b/dmraid.changes index 1c0386e..c4e045d 100644 --- a/dmraid.changes +++ b/dmraid.changes @@ -1,11 +1,3 @@ -------------------------------------------------------------------- -Mon Apr 19 23:11:39 UTC 2010 - nfbrown@novell.com - -- handle_space: cope with arrays with spaces in the name stored - in the metadata (bnc#470696) -- remove_trylock: pthreads_mutex_trylock is still very new in - glibc so safest not to use it yet (bnc#594388) - ------------------------------------------------------------------- Tue Feb 2 03:46:18 UTC 2010 - nfbrown@novell.com diff --git a/dmraid.spec b/dmraid.spec index 6971bee..ec33cc1 100644 --- a/dmraid.spec +++ b/dmraid.spec @@ -38,8 +38,6 @@ Source5: mkinitrd-boot.sh Patch1: dmraid-1.0.0.rc16-cvs-2010-02-02.patch Patch2: dmraid-1.0.0.rc13-geometry.patch Patch3: lib-install.patch -Patch4: handle_spaces -Patch5: remove_trylock BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: %fillup_prereq @@ -74,8 +72,6 @@ Authors: %patch1 -p1 %patch2 -p1 %patch3 -p1 -%patch4 -p1 -%patch5 -p2 cp %{SOURCE3} . %build diff --git a/handle_spaces b/handle_spaces deleted file mode 100644 index 1348009..0000000 --- a/handle_spaces +++ /dev/null @@ -1,73 +0,0 @@ ---- - include/dmraid/misc.h | 1 + - lib/format/ataraid/isw.c | 7 ++++++- - lib/format/ddf/ddf1.c | 1 + - lib/misc/misc.c | 14 ++++++++++++++ - 4 files changed, 22 insertions(+), 1 deletion(-) - ---- 1.0.0.rc16.orig/include/dmraid/misc.h -+++ 1.0.0.rc16/include/dmraid/misc.h -@@ -18,6 +18,7 @@ extern void libdmraid_exit(struct lib_co - - extern void sysfs_workaround(struct lib_context *lc); - extern void mk_alpha(struct lib_context *lc, char *str, size_t len); -+extern void mk_alphanum(struct lib_context *lc, char *str, size_t len); - extern char *get_basename(struct lib_context *lc, char *str); - extern char *get_dirname(struct lib_context *lc, char *str); - extern char *remove_white_space(struct lib_context *lc, char *str, size_t len); ---- 1.0.0.rc16.orig/lib/format/ataraid/isw.c -+++ 1.0.0.rc16/lib/format/ataraid/isw.c -@@ -169,6 +169,7 @@ static size_t - _name(struct lib_context *lc, struct isw *isw, char *str, size_t len, - enum name_type nt, int num, struct isw_dev *dev, struct raid_dev *rd) - { -+ int n; - struct { - const char *fmt, *what; - } formats[] = { -@@ -189,7 +190,11 @@ _name(struct lib_context *lc, struct isw - f += (is_raid10(dev) ? 1 : 0); - } - -- return snprintf(str, len, f->fmt, isw->family_num, f->what, num); -+ n = snprintf(str, len, f->fmt, isw->family_num, f->what, num); -+ /* As '->volume' could contain anything, we need to sanitise the name */ -+ if (str) -+ mk_alphanum(lc, str, n); -+ return n; - } - - static char * ---- 1.0.0.rc16.orig/lib/format/ddf/ddf1.c -+++ 1.0.0.rc16/lib/format/ddf/ddf1.c -@@ -689,6 +689,7 @@ name(struct lib_context *lc, struct ddf1 - i = prefix + 16; - while (!isgraph(buf[--i])); - buf[i + 1] = 0; -+ mk_alphanum(lc, buf, i); - } else { - char *b; - ---- 1.0.0.rc16.orig/lib/misc/misc.c -+++ 1.0.0.rc16/lib/misc/misc.c -@@ -66,6 +66,20 @@ mk_alpha(struct lib_context *lc, char *s - } - } - -+/* Convert a string to only have alphanum or '-' or '_'. -+ * All others become '_' -+ */ -+void -+mk_alphanum(struct lib_context *lc, char *str, size_t len) -+{ -+ for (; len && *str; len--, str++) { -+ if (!isalnum(*str) && -+ *str != '-' && -+ *str != '_') -+ *str = '_'; -+ } -+} -+ - /* Remove any whitespace from a string. */ - char * - remove_white_space(struct lib_context *lc, char *str, size_t size) diff --git a/remove_trylock b/remove_trylock deleted file mode 100644 index f7997eb..0000000 --- a/remove_trylock +++ /dev/null @@ -1,35 +0,0 @@ -Remove call to pthreads_mutex_trylock - -Reference bnc -594388 -This appears only to be in very recent releases of glibc. -Its presence causes - -/sbin/dmraid -ay -p -The dynamic shared library "libdmraid-events-isw.so" could not be loaded: - /lib/libdmraid-events-isw.so: undefined symbol: pthread_mutex_trylock - -on openSUSE 11.3, it is is not used for anything except a simple -logging message. - -Signed-off-by: NeilBrown - ---- - 1.0.0.rc16/lib/events/libdmraid-events-isw.c | 6 +----- - 1 file changed, 1 insertion(+), 5 deletions(-) - ---- dmraid.orig/1.0.0.rc16/lib/events/libdmraid-events-isw.c -+++ dmraid/1.0.0.rc16/lib/events/libdmraid-events-isw.c -@@ -1433,11 +1433,7 @@ void process_event(struct dm_task *dmt, - /* - * Make sure, events are processed sequentially per RAID set. - */ -- if (pthread_mutex_trylock(&rs->event_mutex)) { -- syslog(LOG_NOTICE, -- " Another thread is handling an event. Waiting..."); -- pthread_mutex_lock(&rs->event_mutex); -- } -+ pthread_mutex_lock(&rs->event_mutex); - - do { - next = dm_get_next_target(dmt, next, &start, &length, From c22ea25adef7ad996600c2d5f211e9de2028c4ed99784ce71942300c87609d05 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Thu, 16 Sep 2010 10:19:44 +0000 Subject: [PATCH 4/5] OBS-URL: https://build.opensuse.org/package/show/Base:System/dmraid?expand=0&rev=16 --- dmraid.changes | 8 ++++++ dmraid.spec | 6 ++++- handle_spaces | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++ remove_trylock | 35 ++++++++++++++++++++++++ 4 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 handle_spaces create mode 100644 remove_trylock diff --git a/dmraid.changes b/dmraid.changes index c4e045d..1c0386e 100644 --- a/dmraid.changes +++ b/dmraid.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Apr 19 23:11:39 UTC 2010 - nfbrown@novell.com + +- handle_space: cope with arrays with spaces in the name stored + in the metadata (bnc#470696) +- remove_trylock: pthreads_mutex_trylock is still very new in + glibc so safest not to use it yet (bnc#594388) + ------------------------------------------------------------------- Tue Feb 2 03:46:18 UTC 2010 - nfbrown@novell.com diff --git a/dmraid.spec b/dmraid.spec index ec33cc1..5e4a64a 100644 --- a/dmraid.spec +++ b/dmraid.spec @@ -28,7 +28,7 @@ Group: System/Base AutoReqProv: on Summary: A Device-Mapper Software RAID Support Tool Version: 1.0.0.rc16 -Release: 1 +Release: 2 Source: ftp://people.redhat.com/heinzm/sw/dmraid/src/dmraid-%{version}.tar.bz2 Source1: sysconfig.dmraid Source2: boot.dmraid @@ -38,6 +38,8 @@ Source5: mkinitrd-boot.sh Patch1: dmraid-1.0.0.rc16-cvs-2010-02-02.patch Patch2: dmraid-1.0.0.rc13-geometry.patch Patch3: lib-install.patch +Patch4: handle_spaces +Patch5: remove_trylock BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: %fillup_prereq @@ -72,6 +74,8 @@ Authors: %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 +%patch5 -p2 cp %{SOURCE3} . %build diff --git a/handle_spaces b/handle_spaces new file mode 100644 index 0000000..1348009 --- /dev/null +++ b/handle_spaces @@ -0,0 +1,73 @@ +--- + include/dmraid/misc.h | 1 + + lib/format/ataraid/isw.c | 7 ++++++- + lib/format/ddf/ddf1.c | 1 + + lib/misc/misc.c | 14 ++++++++++++++ + 4 files changed, 22 insertions(+), 1 deletion(-) + +--- 1.0.0.rc16.orig/include/dmraid/misc.h ++++ 1.0.0.rc16/include/dmraid/misc.h +@@ -18,6 +18,7 @@ extern void libdmraid_exit(struct lib_co + + extern void sysfs_workaround(struct lib_context *lc); + extern void mk_alpha(struct lib_context *lc, char *str, size_t len); ++extern void mk_alphanum(struct lib_context *lc, char *str, size_t len); + extern char *get_basename(struct lib_context *lc, char *str); + extern char *get_dirname(struct lib_context *lc, char *str); + extern char *remove_white_space(struct lib_context *lc, char *str, size_t len); +--- 1.0.0.rc16.orig/lib/format/ataraid/isw.c ++++ 1.0.0.rc16/lib/format/ataraid/isw.c +@@ -169,6 +169,7 @@ static size_t + _name(struct lib_context *lc, struct isw *isw, char *str, size_t len, + enum name_type nt, int num, struct isw_dev *dev, struct raid_dev *rd) + { ++ int n; + struct { + const char *fmt, *what; + } formats[] = { +@@ -189,7 +190,11 @@ _name(struct lib_context *lc, struct isw + f += (is_raid10(dev) ? 1 : 0); + } + +- return snprintf(str, len, f->fmt, isw->family_num, f->what, num); ++ n = snprintf(str, len, f->fmt, isw->family_num, f->what, num); ++ /* As '->volume' could contain anything, we need to sanitise the name */ ++ if (str) ++ mk_alphanum(lc, str, n); ++ return n; + } + + static char * +--- 1.0.0.rc16.orig/lib/format/ddf/ddf1.c ++++ 1.0.0.rc16/lib/format/ddf/ddf1.c +@@ -689,6 +689,7 @@ name(struct lib_context *lc, struct ddf1 + i = prefix + 16; + while (!isgraph(buf[--i])); + buf[i + 1] = 0; ++ mk_alphanum(lc, buf, i); + } else { + char *b; + +--- 1.0.0.rc16.orig/lib/misc/misc.c ++++ 1.0.0.rc16/lib/misc/misc.c +@@ -66,6 +66,20 @@ mk_alpha(struct lib_context *lc, char *s + } + } + ++/* Convert a string to only have alphanum or '-' or '_'. ++ * All others become '_' ++ */ ++void ++mk_alphanum(struct lib_context *lc, char *str, size_t len) ++{ ++ for (; len && *str; len--, str++) { ++ if (!isalnum(*str) && ++ *str != '-' && ++ *str != '_') ++ *str = '_'; ++ } ++} ++ + /* Remove any whitespace from a string. */ + char * + remove_white_space(struct lib_context *lc, char *str, size_t size) diff --git a/remove_trylock b/remove_trylock new file mode 100644 index 0000000..f7997eb --- /dev/null +++ b/remove_trylock @@ -0,0 +1,35 @@ +Remove call to pthreads_mutex_trylock + +Reference bnc +594388 +This appears only to be in very recent releases of glibc. +Its presence causes + +/sbin/dmraid -ay -p +The dynamic shared library "libdmraid-events-isw.so" could not be loaded: + /lib/libdmraid-events-isw.so: undefined symbol: pthread_mutex_trylock + +on openSUSE 11.3, it is is not used for anything except a simple +logging message. + +Signed-off-by: NeilBrown + +--- + 1.0.0.rc16/lib/events/libdmraid-events-isw.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +--- dmraid.orig/1.0.0.rc16/lib/events/libdmraid-events-isw.c ++++ dmraid/1.0.0.rc16/lib/events/libdmraid-events-isw.c +@@ -1433,11 +1433,7 @@ void process_event(struct dm_task *dmt, + /* + * Make sure, events are processed sequentially per RAID set. + */ +- if (pthread_mutex_trylock(&rs->event_mutex)) { +- syslog(LOG_NOTICE, +- " Another thread is handling an event. Waiting..."); +- pthread_mutex_lock(&rs->event_mutex); +- } ++ pthread_mutex_lock(&rs->event_mutex); + + do { + next = dm_get_next_target(dmt, next, &start, &length, From 2f764f0e303a78563fab32e6a51081209b2ac2ebacd8bdfc304ecd5bb45c8885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= Date: Sat, 28 May 2011 20:50:00 +0000 Subject: [PATCH 5/5] Accepting request 71649 from home:lnussel:branches:Base:System - don't hard require boot.device-mapper in boot.dmraid. dm-mod is autoloaded when accessing /dev/mapper/control anyways. OBS-URL: https://build.opensuse.org/request/show/71649 OBS-URL: https://build.opensuse.org/package/show/Base:System/dmraid?expand=0&rev=17 --- boot.dmraid | 6 +++--- dmraid.changes | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/boot.dmraid b/boot.dmraid index 91c7af7..0047fca 100644 --- a/boot.dmraid +++ b/boot.dmraid @@ -6,10 +6,10 @@ # ### BEGIN INIT INFO # Provides: boot.dmraid -# Required-Start: boot.device-mapper boot.udev boot.rootfsck -# Should-Start: boot.multipath boot.md boot.scsidev +# Required-Start: boot.udev boot.rootfsck +# Should-Start: boot.device-mapper boot.multipath boot.md boot.scsidev # X-Start-Before: boot.localfs -# Required-Stop: boot.device-mapper boot.udev boot.rootfsck +# Required-Stop: boot.udev boot.rootfsck # Should-Stop: boot.multipath boot.md boot.scsidev # X-Stop-Before: boot.localfs # Default-Start: B diff --git a/dmraid.changes b/dmraid.changes index 1c0386e..d8f9795 100644 --- a/dmraid.changes +++ b/dmraid.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri May 27 09:29:31 UTC 2011 - lnussel@suse.de + +- don't hard require boot.device-mapper in boot.dmraid. dm-mod is + autoloaded when accessing /dev/mapper/control anyways. + ------------------------------------------------------------------- Mon Apr 19 23:11:39 UTC 2010 - nfbrown@novell.com