Skip to contentSkip to conversation

multipathd pthread locking fix

PATCH Applied Alex Zeffertt 2 participants 2 messages Feb 3, 2010 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 multipathd pthread locking fix

The following patch is needed to stop multipathd segfaulting on uClibc.

Regards,

Alex Zeffertt

Fix pthread bug in multipath-tools.

You should lock the mutex before doing a pthread_cond_wait otherwise undefined results occur. In fact we get away with this with glibc, but with uclibc it causes a segfault.

multipathd/main.c renamed from multipathd/main.c.orig +1 -0
@@ -1668,6 +1668,7 @@
 	/*pthread_create(&uevent_thr, &attr, ueventloop, vecs);*/
 	pthread_create(&uxlsnr_thr, &attr, uxlsnrloop, vecs);
 
+	lock(&exit_mutex);
 	pthread_cond_wait(&exit_cond, &exit_mutex);
 
 	/*