]> git.baikalelectronics.ru Git - kernel.git/commit
ipvs: Fix possible deadlock in estimator code
authorSven Wegener <sven.wegener@stealer.net>
Sun, 10 Aug 2008 09:17:59 +0000 (09:17 +0000)
committerSven Wegener <sven.wegener@stealer.net>
Mon, 11 Aug 2008 09:45:40 +0000 (11:45 +0200)
commit72765ee1e8f55adfa2f859624559e0db9cdf9d02
tree031f48201a1e3a07a22a8f6734d0bb1c806b2c28
parent5120e954b08d0f88a7f730f0beb4b0321893ff50
ipvs: Fix possible deadlock in estimator code

There is a slight chance for a deadlock in the estimator code. We can't call
del_timer_sync() while holding our lock, as the timer might be active and
spinning for the lock on another cpu. Work around this issue by using
try_to_del_timer_sync() and releasing the lock. We could actually delete the
timer outside of our lock, as the add and kill functions are only every called
from userspace via [gs]etsockopt() and are serialized by a mutex, but better
make this explicit.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Cc: stable <stable@kernel.org>
Acked-by: Simon Horman <horms@verge.net.au>
net/ipv4/ipvs/ip_vs_est.c