LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [patch] ipvs: Use atomic operations atomicly

To: Simon Horman <horms@xxxxxxxxxxxx>
Subject: Re: [patch] ipvs: Use atomic operations atomicly
Cc: lvs-devel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, 홍신 shin hong <hongshin@xxxxxxxxx>, David Miller <davem@xxxxxxxxxxxxx>
From: Patrick McHardy <kaber@xxxxxxxxx>
Date: Mon, 31 Aug 2009 14:22:26 +0200
Simon Horman wrote:
> A pointed out by Shin Hong, IPVS doesn't always use atomic operations
> in an atomic manner. While this seems unlikely to be manifest in
> strange behaviour, it seems appropriate to clean this up.
> 
> Cc: 홍신 shin hong <hongshin@xxxxxxxxx>
> Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>

Applied, thanks.

>       if (af == AF_INET &&
>           (ip_vs_sync_state & IP_VS_STATE_MASTER) &&
>           (((cp->protocol != IPPROTO_TCP ||
>              cp->state == IP_VS_TCP_S_ESTABLISHED) &&
> -           (atomic_read(&cp->in_pkts) % sysctl_ip_vs_sync_threshold[1]
> +           (pkts % sysctl_ip_vs_sync_threshold[1]

It seems that proc_do_sync_threshold() should check whether this value
is zero. The current checks also look racy since incorrect values are
first updated, then overwritten again.

--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

<Prev in Thread] Current Thread [Next in Thread>