On Fri, Jul 24, 2015 at 07:13:06PM +0300, Vladimir Davydov wrote: ... > > prefer counter. What's the profit of using @ve_netns instead? > > Because this way it will always work, while your approach won't. In case > of VZCTL_TC_CLEAR_STAT you can get away by taking the req_mutex, but it > simply won't work with venet_acct_set_base.
True. Fix on top attached. Thank you!
From: Cyrill Gorcunov <[email protected]> Subject: [PATCH rh7] ve/vznetstat: Fix potential exit race When container is exiting another task may be doing operations with statistics incrementing/decrementing stat counter, which may lead to situation where counter is not zero, thus we don't zap @ve->stat member. Fix it by testing if the net is the last one belonging to a container. https://jira.sw.ru/browse/PSBM-35178 Signed-off-by: Cyrill Gorcunov <[email protected]> CC: Andrey Vagin <[email protected]> CC: Vladimir Davydov <[email protected]> CC: Konstantin Khorenko <[email protected]> CC: Pavel Emelyanov <[email protected]> CC: Igor Sukhih <[email protected]> --- kernel/ve/vznetstat/vznetstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-pcs7.git/kernel/ve/vznetstat/vznetstat.c =================================================================== --- linux-pcs7.git.orig/kernel/ve/vznetstat/vznetstat.c +++ linux-pcs7.git/kernel/ve/vznetstat/vznetstat.c @@ -1098,7 +1098,7 @@ static void __net_exit net_exit_acct(str if (ve->stat) { venet_acct_put_stat(ve->stat); - if (atomic_read(&ve->stat->users) == 0) + if (ve->ve_netns == net) ve->stat = NULL; } }
_______________________________________________ Devel mailing list [email protected] https://lists.openvz.org/mailman/listinfo/devel
