libmultipath: fix crash on shutdown if io_err thread isn't running
authorMartin Wilck <mwilck@suse.com>
Wed, 7 Mar 2018 23:08:56 +0000 (00:08 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Sat, 10 Mar 2018 07:22:09 +0000 (08:22 +0100)
If we've never created the io_error checker thread, we shouldn't
cancel it.

Fixes: 160da9fa4339 "multipathd: start marginal path checker thread
lazily"

Signed-off-by: Martin Wilck <mwilck@suse.com>
libmultipath/io_err_stat.c

index ac81b4b..02b1453 100644 (file)
@@ -793,6 +793,9 @@ destroy_ctx:
 
 void stop_io_err_stat_thread(void)
 {
+       if (io_err_stat_thr == (pthread_t)0)
+               return;
+
        if (uatomic_read(&io_err_thread_running) == 1)
                pthread_cancel(io_err_stat_thr);