mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
Fix missing thread list manipulation
For manipulation with thread list to avoid race with timeout thread, take also _timeout_mutex.
This commit is contained in:
parent
1b9a70b6af
commit
b0f1e29335
@ -1,5 +1,6 @@
|
||||
Version 2.02.89 -
|
||||
==================================
|
||||
Fix missing thread list manipulation protection in dmeventd.
|
||||
Do not derefence lv pointer in _percent_run() function before NULL check.
|
||||
Allow empty strings for description and creation_host config fields.
|
||||
Issue deprecation warning when removing last lvm1-format snapshot.
|
||||
|
@ -739,8 +739,10 @@ static void _monitor_unregister(void *arg)
|
||||
return;
|
||||
}
|
||||
thread->status = DM_THREAD_DONE;
|
||||
pthread_mutex_lock(&_timeout_mutex);
|
||||
UNLINK_THREAD(thread);
|
||||
LINK(thread, &_thread_registry_unused);
|
||||
pthread_mutex_unlock(&_timeout_mutex);
|
||||
_unlock_mutex();
|
||||
}
|
||||
|
||||
@ -1078,8 +1080,10 @@ static int _unregister_for_event(struct message_data *message_data)
|
||||
* unlink and terminate its monitoring thread.
|
||||
*/
|
||||
if (!thread->events) {
|
||||
pthread_mutex_lock(&_timeout_mutex);
|
||||
UNLINK_THREAD(thread);
|
||||
LINK(thread, &_thread_registry_unused);
|
||||
pthread_mutex_unlock(&_timeout_mutex);
|
||||
}
|
||||
_unlock_mutex();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user