[dm-devel] [PATCH 30/33] tur: Add pthread_testcancel()

Martin Wilck mwilck at suse.com
Tue Feb 28 16:23:26 UTC 2017


From: Hannes Reinecke <hare at suse.de>

When the ioctl returns we need to check if a cancellation has
been requested; otherwise we'd be re-setting the state and
overwrite any pending values.


Signed-off-by: Hannes Reinecke <hare at suse.com>
---
 libmultipath/checkers/tur.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libmultipath/checkers/tur.c b/libmultipath/checkers/tur.c
index d9a9e67d..b4a5cb2f 100644
--- a/libmultipath/checkers/tur.c
+++ b/libmultipath/checkers/tur.c
@@ -268,6 +268,7 @@ static void *tur_thread(void *ctx)
 	pthread_mutex_unlock(&ct->lock);
 
 	state = tur_check(ct->fd, ct->timeout, copy_msg_to_tcc, ct->message);
+	pthread_testcancel();
 
 	/* TUR checker done */
 	pthread_mutex_lock(&ct->lock);
-- 
2.11.0




More information about the dm-devel mailing list