Commit bc0fde2f authored by Sven Wegener's avatar Sven Wegener

ipvs: Fix possible deadlock in sync code

Commit 998e7a76 ("ipvs: Use kthread_run()
instead of doing a double-fork via kernel_thread()") introduced a possible
deadlock in the sync code. We need to use the _bh versions for the lock, as the
lock is also accessed from a bottom half.
Signed-off-by: default avatarSven Wegener <sven.wegener@stealer.net>
Acked-by: default avatarSimon Horman <horms@verge.net.au>
parent 8123b421
...@@ -904,9 +904,9 @@ int stop_sync_thread(int state) ...@@ -904,9 +904,9 @@ int stop_sync_thread(int state)
* progress of stopping the master sync daemon. * progress of stopping the master sync daemon.
*/ */
spin_lock(&ip_vs_sync_lock); spin_lock_bh(&ip_vs_sync_lock);
ip_vs_sync_state &= ~IP_VS_STATE_MASTER; ip_vs_sync_state &= ~IP_VS_STATE_MASTER;
spin_unlock(&ip_vs_sync_lock); spin_unlock_bh(&ip_vs_sync_lock);
kthread_stop(sync_master_thread); kthread_stop(sync_master_thread);
sync_master_thread = NULL; sync_master_thread = NULL;
} else if (state == IP_VS_STATE_BACKUP) { } else if (state == IP_VS_STATE_BACKUP) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment