device-mapper-multipath-0.4.9-49
Modify 0020-RHBZ-907360-static-pthread-init.patch * Don't initialize uevent list twice Add 0029-RH-no-prio-put-msg.patch Add 0030-RHBZ-916528-override-queue-no-daemon.patch * Default to "queue_without_daemon no" * Add "forcequeueing daemon" and "restorequeueing daemon" cli commands Modify spec file to force queue_without_daemon when restarting multipathd on upgrades.
This commit is contained in:
parent
0b94e5c7c2
commit
eaac563644
@ -1,6 +1,6 @@
|
||||
---
|
||||
libmultipath/uevent.c | 10 ++++------
|
||||
1 file changed, 4 insertions(+), 6 deletions(-)
|
||||
libmultipath/uevent.c | 12 ++++--------
|
||||
1 file changed, 4 insertions(+), 8 deletions(-)
|
||||
|
||||
Index: multipath-tools-130222/libmultipath/uevent.c
|
||||
===================================================================
|
||||
@ -19,16 +19,18 @@ Index: multipath-tools-130222/libmultipath/uevent.c
|
||||
uev_trigger *my_uev_trigger;
|
||||
void * my_trigger_data;
|
||||
int servicing_uev;
|
||||
@@ -411,8 +413,6 @@ int uevent_listen(void)
|
||||
@@ -409,10 +411,6 @@ int uevent_listen(void)
|
||||
* thereby not getting to empty the socket's receive buffer queue
|
||||
* often enough.
|
||||
*/
|
||||
INIT_LIST_HEAD(&uevq);
|
||||
|
||||
- INIT_LIST_HEAD(&uevq);
|
||||
-
|
||||
- pthread_mutex_init(uevq_lockp, NULL);
|
||||
- pthread_cond_init(uev_condp, NULL);
|
||||
pthread_cleanup_push(uevq_stop, NULL);
|
||||
|
||||
monitor = udev_monitor_new_from_netlink(conf->udev, "udev");
|
||||
@@ -525,8 +525,6 @@ out:
|
||||
@@ -525,8 +523,6 @@ out:
|
||||
if (need_failback)
|
||||
err = failback_listen();
|
||||
pthread_cleanup_pop(1);
|
||||
|
20
0029-RH-no-prio-put-msg.patch
Normal file
20
0029-RH-no-prio-put-msg.patch
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
libmultipath/prio.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: multipath-tools-130222/libmultipath/prio.c
|
||||
===================================================================
|
||||
--- multipath-tools-130222.orig/libmultipath/prio.c
|
||||
+++ multipath-tools-130222/libmultipath/prio.c
|
||||
@@ -162,7 +162,10 @@ void prio_put (struct prio * dst)
|
||||
if (!dst)
|
||||
return;
|
||||
|
||||
- src = prio_lookup(dst->name);
|
||||
+ if (!strlen(dst->name))
|
||||
+ src = NULL;
|
||||
+ else
|
||||
+ src = prio_lookup(dst->name);
|
||||
memset(dst, 0x0, sizeof(struct prio));
|
||||
free_prio(src);
|
||||
}
|
200
0030-RHBZ-916528-override-queue-no-daemon.patch
Normal file
200
0030-RHBZ-916528-override-queue-no-daemon.patch
Normal file
@ -0,0 +1,200 @@
|
||||
---
|
||||
libmultipath/dict.c | 10 ++++------
|
||||
libmultipath/structs.h | 2 +-
|
||||
multipathd/cli.c | 3 +++
|
||||
multipathd/cli.h | 2 ++
|
||||
multipathd/cli_handlers.c | 18 ++++++++++++++++++
|
||||
multipathd/cli_handlers.h | 2 ++
|
||||
multipathd/main.c | 2 ++
|
||||
multipathd/multipathd.init.redhat | 14 ++++++++++----
|
||||
8 files changed, 42 insertions(+), 11 deletions(-)
|
||||
|
||||
Index: multipath-tools-130222/libmultipath/dict.c
|
||||
===================================================================
|
||||
--- multipath-tools-130222.orig/libmultipath/dict.c
|
||||
+++ multipath-tools-130222/libmultipath/dict.c
|
||||
@@ -438,14 +438,11 @@ def_queue_without_daemon(vector strvec)
|
||||
if (!buff)
|
||||
return 1;
|
||||
|
||||
- if (!strncmp(buff, "off", 3) || !strncmp(buff, "no", 2) ||
|
||||
- !strncmp(buff, "0", 1))
|
||||
- conf->queue_without_daemon = QUE_NO_DAEMON_OFF;
|
||||
- else if (!strncmp(buff, "on", 2) || !strncmp(buff, "yes", 3) ||
|
||||
+ if (!strncmp(buff, "on", 2) || !strncmp(buff, "yes", 3) ||
|
||||
!strncmp(buff, "1", 1))
|
||||
conf->queue_without_daemon = QUE_NO_DAEMON_ON;
|
||||
else
|
||||
- conf->queue_without_daemon = QUE_NO_DAEMON_UNDEF;
|
||||
+ conf->queue_without_daemon = QUE_NO_DAEMON_OFF;
|
||||
|
||||
free(buff);
|
||||
return 0;
|
||||
@@ -2670,8 +2667,9 @@ snprint_def_queue_without_daemon (char *
|
||||
case QUE_NO_DAEMON_OFF:
|
||||
return snprintf(buff, len, "\"no\"");
|
||||
case QUE_NO_DAEMON_ON:
|
||||
- case QUE_NO_DAEMON_UNDEF:
|
||||
return snprintf(buff, len, "\"yes\"");
|
||||
+ case QUE_NO_DAEMON_FORCE:
|
||||
+ return snprintf(buff, len, "\"forced\"");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Index: multipath-tools-130222/libmultipath/structs.h
|
||||
===================================================================
|
||||
--- multipath-tools-130222.orig/libmultipath/structs.h
|
||||
+++ multipath-tools-130222/libmultipath/structs.h
|
||||
@@ -67,9 +67,9 @@ enum pgstates {
|
||||
};
|
||||
|
||||
enum queue_without_daemon_states {
|
||||
- QUE_NO_DAEMON_UNDEF,
|
||||
QUE_NO_DAEMON_OFF,
|
||||
QUE_NO_DAEMON_ON,
|
||||
+ QUE_NO_DAEMON_FORCE,
|
||||
};
|
||||
|
||||
enum pgtimeouts {
|
||||
Index: multipath-tools-130222/multipathd/cli.c
|
||||
===================================================================
|
||||
--- multipath-tools-130222.orig/multipathd/cli.c
|
||||
+++ multipath-tools-130222/multipathd/cli.c
|
||||
@@ -162,6 +162,7 @@ load_keys (void)
|
||||
r += add_key(keys, "resize", RESIZE, 0);
|
||||
r += add_key(keys, "reset", RESET, 0);
|
||||
r += add_key(keys, "reload", RELOAD, 0);
|
||||
+ r += add_key(keys, "forcequeueing", FORCEQ, 0);
|
||||
r += add_key(keys, "disablequeueing", DISABLEQ, 0);
|
||||
r += add_key(keys, "restorequeueing", RESTOREQ, 0);
|
||||
r += add_key(keys, "paths", PATHS, 0);
|
||||
@@ -459,6 +460,8 @@ cli_init (void) {
|
||||
add_handler(GETPRSTATUS+MAP, NULL);
|
||||
add_handler(SETPRSTATUS+MAP, NULL);
|
||||
add_handler(UNSETPRSTATUS+MAP, NULL);
|
||||
+ add_handler(FORCEQ+DAEMON, NULL);
|
||||
+ add_handler(RESTOREQ+DAEMON, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Index: multipath-tools-130222/multipathd/cli.h
|
||||
===================================================================
|
||||
--- multipath-tools-130222.orig/multipathd/cli.h
|
||||
+++ multipath-tools-130222/multipathd/cli.h
|
||||
@@ -10,6 +10,7 @@ enum {
|
||||
__RESIZE,
|
||||
__RESET,
|
||||
__RELOAD,
|
||||
+ __FORCEQ,
|
||||
__DISABLEQ,
|
||||
__RESTOREQ,
|
||||
__PATHS,
|
||||
@@ -45,6 +46,7 @@ enum {
|
||||
#define RESIZE (1 << __RESIZE)
|
||||
#define RESET (1 << __RESET)
|
||||
#define RELOAD (1 << __RELOAD)
|
||||
+#define FORCEQ (1 << __FORCEQ)
|
||||
#define DISABLEQ (1 << __DISABLEQ)
|
||||
#define RESTOREQ (1 << __RESTOREQ)
|
||||
#define PATHS (1 << __PATHS)
|
||||
Index: multipath-tools-130222/multipathd/cli_handlers.c
|
||||
===================================================================
|
||||
--- multipath-tools-130222.orig/multipathd/cli_handlers.c
|
||||
+++ multipath-tools-130222/multipathd/cli_handlers.c
|
||||
@@ -628,6 +628,24 @@ cli_resize(void *v, char **reply, int *l
|
||||
}
|
||||
|
||||
int
|
||||
+cli_force_no_daemon_q(void * v, char ** reply, int * len, void * data)
|
||||
+{
|
||||
+ condlog(2, "force queue_without_daemon (operator)");
|
||||
+ if (conf->queue_without_daemon == QUE_NO_DAEMON_OFF)
|
||||
+ conf->queue_without_daemon = QUE_NO_DAEMON_FORCE;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+cli_restore_no_daemon_q(void * v, char ** reply, int * len, void * data)
|
||||
+{
|
||||
+ condlog(2, "restore queue_without_daemon (operator)");
|
||||
+ if (conf->queue_without_daemon == QUE_NO_DAEMON_FORCE)
|
||||
+ conf->queue_without_daemon = QUE_NO_DAEMON_OFF;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
cli_restore_queueing(void *v, char **reply, int *len, void *data)
|
||||
{
|
||||
struct vectors * vecs = (struct vectors *)data;
|
||||
Index: multipath-tools-130222/multipathd/cli_handlers.h
|
||||
===================================================================
|
||||
--- multipath-tools-130222.orig/multipathd/cli_handlers.h
|
||||
+++ multipath-tools-130222/multipathd/cli_handlers.h
|
||||
@@ -28,6 +28,8 @@ int cli_suspend(void * v, char ** reply,
|
||||
int cli_resume(void * v, char ** reply, int * len, void * data);
|
||||
int cli_reinstate(void * v, char ** reply, int * len, void * data);
|
||||
int cli_fail(void * v, char ** reply, int * len, void * data);
|
||||
+int cli_force_no_daemon_q(void * v, char ** reply, int * len, void * data);
|
||||
+int cli_restore_no_daemon_q(void * v, char ** reply, int * len, void * data);
|
||||
int cli_quit(void * v, char ** reply, int * len, void * data);
|
||||
int cli_shutdown(void * v, char ** reply, int * len, void * data);
|
||||
int cli_reassign (void * v, char ** reply, int * len, void * data);
|
||||
Index: multipath-tools-130222/multipathd/main.c
|
||||
===================================================================
|
||||
--- multipath-tools-130222.orig/multipathd/main.c
|
||||
+++ multipath-tools-130222/multipathd/main.c
|
||||
@@ -904,6 +904,8 @@ uxlsnrloop (void * ap)
|
||||
set_handler_callback(GETPRSTATUS+MAP, cli_getprstatus);
|
||||
set_handler_callback(SETPRSTATUS+MAP, cli_setprstatus);
|
||||
set_handler_callback(UNSETPRSTATUS+MAP, cli_unsetprstatus);
|
||||
+ set_handler_callback(FORCEQ+DAEMON, cli_force_no_daemon_q);
|
||||
+ set_handler_callback(RESTOREQ+DAEMON, cli_restore_no_daemon_q);
|
||||
|
||||
umask(077);
|
||||
uxsock_listen(&uxsock_trigger, ap);
|
||||
Index: multipath-tools-130222/multipathd/multipathd.init.redhat
|
||||
===================================================================
|
||||
--- multipath-tools-130222.orig/multipathd/multipathd.init.redhat
|
||||
+++ multipath-tools-130222/multipathd/multipathd.init.redhat
|
||||
@@ -81,23 +81,28 @@ force_stop() {
|
||||
echo
|
||||
}
|
||||
|
||||
-stop() {
|
||||
+check_root() {
|
||||
root_dev=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $1; }}' /etc/mtab)
|
||||
dm_num=`dmsetup info -c --noheadings -o minor $root_dev 2> /dev/null`
|
||||
if [ $? -eq 0 ]; then
|
||||
root_dm_device="dm-$dm_num"
|
||||
[ -d $syspath/$root_dm_device ] && teardown_slaves $syspath/$root_dm_device
|
||||
fi
|
||||
+}
|
||||
|
||||
- force_stop
|
||||
+force_queue_without_daemon() {
|
||||
+ $DAEMON forcequeueing daemon
|
||||
}
|
||||
|
||||
restart() {
|
||||
- stop
|
||||
+ force_queue_without_daemon
|
||||
+ check_root
|
||||
+ force_stop
|
||||
start
|
||||
}
|
||||
|
||||
force_restart() {
|
||||
+ force_queue_without_daemon
|
||||
force_stop
|
||||
start
|
||||
}
|
||||
@@ -115,7 +120,8 @@ start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
- stop
|
||||
+ check_root
|
||||
+ force_stop
|
||||
;;
|
||||
force-stop)
|
||||
force_stop
|
@ -1,7 +1,7 @@
|
||||
Summary: Tools to manage multipath devices using device-mapper
|
||||
Name: device-mapper-multipath
|
||||
Version: 0.4.9
|
||||
Release: 48%{?dist}
|
||||
Release: 49%{?dist}
|
||||
License: GPL+
|
||||
Group: System Environment/Base
|
||||
URL: http://christophe.varoqui.free.fr/
|
||||
@ -36,6 +36,8 @@ Patch0025: 0025-UPBZ-916668_add_maj_min.patch
|
||||
Patch0026: 0026-fix-checker-time.patch
|
||||
Patch0027: 0027-RH-get-wwid.patch
|
||||
Patch0028: 0028-RHBZ-929078-refresh-udev-dev.patch
|
||||
Patch0029: 0029-RH-no-prio-put-msg.patch
|
||||
Patch0030: 0030-RHBZ-916528-override-queue-no-daemon.patch
|
||||
|
||||
# runtime
|
||||
Requires: %{name}-libs = %{version}-%{release}
|
||||
@ -116,6 +118,8 @@ kpartx manages partition creation and removal for device-mapper devices.
|
||||
%patch0026 -p1
|
||||
%patch0027 -p1
|
||||
%patch0028 -p1
|
||||
%patch0029 -p1
|
||||
%patch0030 -p1
|
||||
cp %{SOURCE1} .
|
||||
|
||||
%build
|
||||
@ -148,6 +152,9 @@ rm -rf %{buildroot}
|
||||
%systemd_preun multipathd.service
|
||||
|
||||
%postun
|
||||
if [ $1 -ge 1 ] ; then
|
||||
/sbin/multipathd forcequeueing daemon > /dev/null 2>&1 || :
|
||||
fi
|
||||
%systemd_postun_with_restart multipathd.service
|
||||
|
||||
%triggerun -- %{name} < 0.4.9-37
|
||||
@ -206,6 +213,16 @@ bin/systemctl --no-reload enable multipathd.service >/dev/null 2>&1 ||:
|
||||
%{_mandir}/man8/kpartx.8.gz
|
||||
|
||||
%changelog
|
||||
* Fri Apr 26 2013 Benjamin Marzinski <bmarzins@redhat.com> 0.4.9-49
|
||||
- Modify 0020-RHBZ-907360-static-pthread-init.patch
|
||||
* Don't initialize uevent list twice
|
||||
- Add 0029-RH-no-prio-put-msg.patch
|
||||
- Add 0030-RHBZ-916528-override-queue-no-daemon.patch
|
||||
* Default to "queue_without_daemon no"
|
||||
* Add "forcequeueing daemon" and "restorequeueing daemon" cli commands
|
||||
- Modify spec file to force queue_without_daemon when restarting
|
||||
multipathd on upgrades.
|
||||
|
||||
* Thu Apr 4 2013 Benjamin Marzinski <bmarzins@redhat.com> 0.4.9-48
|
||||
- Add 0026-fix-checker-time.patch
|
||||
* Once multipathd hit it max checker interval, it was reverting to
|
||||
|
Loading…
Reference in New Issue
Block a user