diff options
author | Sven Wegener <sven.wegener@stealer.net> | 2008-08-10 05:14:05 -0400 |
---|---|---|
committer | Sven Wegener <sven.wegener@stealer.net> | 2008-08-11 05:44:38 -0400 |
commit | bc0fde2fad007a81ecffceb25a893a6c3f1ed767 (patch) | |
tree | 961823abcc7cabcfde900fdc58d8a19178c0c5a7 /net/ipv4/ipvs/ip_vs_sync.c | |
parent | 8123b421e8ed944671d7241323ed3198cccb4041 (diff) |
ipvs: Fix possible deadlock in sync code
Commit 998e7a76804b7a273a0460c2cdd5a51fa9856717 ("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: Sven Wegener <sven.wegener@stealer.net>
Acked-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'net/ipv4/ipvs/ip_vs_sync.c')
-rw-r--r-- | net/ipv4/ipvs/ip_vs_sync.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c index 45e9bd96c286..a652da2c3200 100644 --- a/net/ipv4/ipvs/ip_vs_sync.c +++ b/net/ipv4/ipvs/ip_vs_sync.c | |||
@@ -904,9 +904,9 @@ int stop_sync_thread(int state) | |||
904 | * progress of stopping the master sync daemon. | 904 | * progress of stopping the master sync daemon. |
905 | */ | 905 | */ |
906 | 906 | ||
907 | spin_lock(&ip_vs_sync_lock); | 907 | spin_lock_bh(&ip_vs_sync_lock); |
908 | ip_vs_sync_state &= ~IP_VS_STATE_MASTER; | 908 | ip_vs_sync_state &= ~IP_VS_STATE_MASTER; |
909 | spin_unlock(&ip_vs_sync_lock); | 909 | spin_unlock_bh(&ip_vs_sync_lock); |
910 | kthread_stop(sync_master_thread); | 910 | kthread_stop(sync_master_thread); |
911 | sync_master_thread = NULL; | 911 | sync_master_thread = NULL; |
912 | } else if (state == IP_VS_STATE_BACKUP) { | 912 | } else if (state == IP_VS_STATE_BACKUP) { |