Re: [PATCH 6/6] multipathd: Remove a busy-waiting loop

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

 



On 08/17/2016 12:42 PM, Dragan Stancevic wrote:
Hi Bart-

are the semantics below really safe, the don't appear to? Any caller of
checker_thread_running is relaying on stale information. The
c->thread_running could have changed as soon as you unlock.

+static unsigned checker_thread_running(struct tur_checker_context *ct)
+{
+unsigned thread_running;
+
+pthread_spin_lock(&ct->hldr_lock);
+thread_running = ct->thread_running;
+pthread_spin_unlock(&ct->hldr_lock);
+
+return thread_running;
+}

Hello Dragan,

If you have a look at libcheck_check() in tur.c then you will see that it is harmless if checker_thread_running() returns old information.

Bart.


--
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