device-mapper-multipath/0043-RH-signal-waiter.patch
Benjamin Marzinski 37dccf5dea device-mapper-multipath-0.4.9-52
Add 0038-RHBZ-799860-netapp-config.patch
Add 0039-RH-detect-prio-fix.patch
  * Don't autodetect ALUA prioritizer unless it actually can get a priority
Add 0040-RH-bindings-fix.patch
  * Do a better job of trying to get the first free user_friendly_name
Add 0041-RH-check-for-erofs.patch
  * Don't create/reload a device read-only unless doing it read/write fails
    with EROFS
Remove 0017-RH-fix-sigusr1.patch
  * fix signal handling upstream way instead
Add 0042-UP-fix-signal-handling.patch
  * uxlsnr now handles all the signals sent to multipathd. This makes its
    signal handling posix compliant, and harder to mess up.
Add 0043-RH-signal-waiter.patch
  * ioctl isn't a pthread cancellation point.  Send a signal to the waiter
    thread to break out of waiting in ioctl for a dm event.
2013-06-21 11:16:29 -05:00

72 lines
1.8 KiB
Diff

---
libmultipath/waiter.c | 9 +++++++++
multipathd/main.c | 8 ++++++++
2 files changed, 17 insertions(+)
Index: multipath-tools-130222/libmultipath/waiter.c
===================================================================
--- multipath-tools-130222.orig/libmultipath/waiter.c
+++ multipath-tools-130222/libmultipath/waiter.c
@@ -57,6 +57,7 @@ void stop_waiter_thread (struct multipat
thread = mpp->waiter;
mpp->waiter = (pthread_t)0;
pthread_cancel(thread);
+ pthread_kill(thread, SIGUSR2);
}
/*
@@ -65,6 +66,7 @@ void stop_waiter_thread (struct multipat
*/
int waiteventloop (struct event_thread *waiter)
{
+ sigset_t set, oldset;
int event_nr;
int r;
@@ -97,8 +99,15 @@ int waiteventloop (struct event_thread *
dm_task_no_open_count(waiter->dmt);
/* wait */
+ sigemptyset(&set);
+ sigaddset(&set, SIGUSR2);
+ pthread_sigmask(SIG_UNBLOCK, &set, &oldset);
+
+ pthread_testcancel();
r = dm_task_run(waiter->dmt);
+ pthread_testcancel();
+ pthread_sigmask(SIG_SETMASK, &oldset, NULL);
dm_task_destroy(waiter->dmt);
waiter->dmt = NULL;
Index: multipath-tools-130222/multipathd/main.c
===================================================================
--- multipath-tools-130222.orig/multipathd/main.c
+++ multipath-tools-130222/multipathd/main.c
@@ -1506,6 +1506,12 @@ sigusr1 (int sig)
}
static void
+sigusr2 (int sig)
+{
+ condlog(3, "SIGUSR2 received");
+}
+
+static void
signal_init(void)
{
sigset_t set;
@@ -1513,10 +1519,12 @@ signal_init(void)
sigemptyset(&set);
sigaddset(&set, SIGHUP);
sigaddset(&set, SIGUSR1);
+ sigaddset(&set, SIGUSR2);
pthread_sigmask(SIG_BLOCK, &set, NULL);
signal_set(SIGHUP, sighup);
signal_set(SIGUSR1, sigusr1);
+ signal_set(SIGUSR2, sigusr2);
signal_set(SIGINT, sigend);
signal_set(SIGTERM, sigend);
signal(SIGPIPE, SIG_IGN);