[PATCH 1/4] libmultipath: fix crash on shutdown if io_err thread isn't running

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
---
 libmultipath/io_err_stat.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libmultipath/io_err_stat.c b/libmultipath/io_err_stat.c
index ac81b4b9390d..02b1453ea527 100644
--- a/libmultipath/io_err_stat.c
+++ b/libmultipath/io_err_stat.c
@@ -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);
 
-- 
2.16.1

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel



[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux