netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipvs: fix dst_lock locking on dest update
@ 2011-02-22  8:40 Julian Anastasov
  2011-02-23  0:26 ` Simon Horman
  0 siblings, 1 reply; 4+ messages in thread
From: Julian Anastasov @ 2011-02-22  8:40 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, lvs-devel, Simon Horman


 	Fix dst_lock usage in __ip_vs_update_dest. We need
_bh locking because destination is updated in user context.
Can cause lockups on frequent destination updates.
Problem reported by Simon Kirby. Bug was introduced
in 2.6.37 from the "ipvs: changes for local real server"
change.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
---

 	Dave, please apply to net-2.6.
Patch is for 2.6.37+ and applies to 2.6.38-rc6. There is
little fuzz when applying to net-next, let me know if
I should provide patch for other trees.

--- linux-2.6.37/net/netfilter/ipvs/ip_vs_ctl.c	2011-01-06 00:01:23.600069161 +0200
+++ linux/net/netfilter/ipvs/ip_vs_ctl.c	2011-02-19 23:14:44.463250743 +0200
@@ -810,9 +810,9 @@ __ip_vs_update_dest(struct ip_vs_service
  	dest->u_threshold = udest->u_threshold;
  	dest->l_threshold = udest->l_threshold;

-	spin_lock(&dest->dst_lock);
+	spin_lock_bh(&dest->dst_lock);
  	ip_vs_dst_reset(dest);
-	spin_unlock(&dest->dst_lock);
+	spin_unlock_bh(&dest->dst_lock);

  	if (add)
  		ip_vs_new_estimator(&dest->stats);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ipvs: fix dst_lock locking on dest update
@ 2011-02-22  9:11 Hans Schillstrom
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Schillstrom @ 2011-02-22  9:11 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: David S. Miller, netdev, lvs-devel, Simon Horman

>---- Original Message ----
>From: Julian Anastasov <ja@ssi.bg>
>To: "David S. Miller" <davem@davemloft.net>
>Cc: netdev@vger.kernel.org, lvs-devel@vger.kernel.org, "Simon Horman" <horms@verge.net.au>
>Sent: Tue, Feb 22, 2011, 9:36 AM
>Subject: [PATCH] ipvs: fix dst_lock locking on dest update
>
>Fix dst_lock usage in __ip_vs_update_dest. We need
>_bh locking because destination is updated in user context.
>Can cause lockups on frequent destination updates.
>Problem reported by Simon Kirby. Bug was introduced
>in 2.6.37 from the "ipvs: changes for local real server"
>change.
>
>Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Hans Schillstrom <hans@schillstrom.com>

>---
>
> 	Dave, please apply to net-2.6.
>Patch is for 2.6.37+ and applies to 2.6.38-rc6. There is
>little fuzz when applying to net-next, let me know if
>I should provide patch for other trees.

The patch seems to be OK in 2.6.38 expcept for line number.
All my thest runs without any problems.

>
>--- linux-2.6.37/net/netfilter/ipvs/ip_vs_ctl.c	2011-01-06 00:01:23.600069161 +0200
>+++ linux/net/netfilter/ipvs/ip_vs_ctl.c	2011-02-19 23:14:44.463250743 +0200
>@@ -810,9 +810,9 @@ __ip_vs_update_dest(struct ip_vs_service
>  	dest->u_threshold = udest->u_threshold;
>  	dest->l_threshold = udest->l_threshold;
>
>-	spin_lock(&dest->dst_lock);
>+	spin_lock_bh(&dest->dst_lock);
>  	ip_vs_dst_reset(dest);
>-	spin_unlock(&dest->dst_lock);
>+	spin_unlock_bh(&dest->dst_lock);
>
>  	if (add)
>  		ip_vs_new_estimator(&dest->stats);
>--


Hans Schillstrom <hans@schillstrom.com>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ipvs: fix dst_lock locking on dest update
  2011-02-22  8:40 [PATCH] ipvs: fix dst_lock locking on dest update Julian Anastasov
@ 2011-02-23  0:26 ` Simon Horman
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2011-02-23  0:26 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: David S. Miller, netdev, lvs-devel

On Tue, Feb 22, 2011 at 10:40:25AM +0200, Julian Anastasov wrote:
> 
> 	Fix dst_lock usage in __ip_vs_update_dest. We need
> _bh locking because destination is updated in user context.
> Can cause lockups on frequent destination updates.
> Problem reported by Simon Kirby. Bug was introduced
> in 2.6.37 from the "ipvs: changes for local real server"
> change.
> 
> Signed-off-by: Julian Anastasov <ja@ssi.bg>

Acked-by: Simon Horman <horms@verge.net.au>

> ---
> 
> 	Dave, please apply to net-2.6.
> Patch is for 2.6.37+ and applies to 2.6.38-rc6. There is
> little fuzz when applying to net-next, let me know if
> I should provide patch for other trees.
> 
> --- linux-2.6.37/net/netfilter/ipvs/ip_vs_ctl.c	2011-01-06 00:01:23.600069161 +0200
> +++ linux/net/netfilter/ipvs/ip_vs_ctl.c	2011-02-19 23:14:44.463250743 +0200
> @@ -810,9 +810,9 @@ __ip_vs_update_dest(struct ip_vs_service
>  	dest->u_threshold = udest->u_threshold;
>  	dest->l_threshold = udest->l_threshold;
> 
> -	spin_lock(&dest->dst_lock);
> +	spin_lock_bh(&dest->dst_lock);
>  	ip_vs_dst_reset(dest);
> -	spin_unlock(&dest->dst_lock);
> +	spin_unlock_bh(&dest->dst_lock);
> 
>  	if (add)
>  		ip_vs_new_estimator(&dest->stats);
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ipvs: fix dst_lock locking on dest update
  2011-03-01 22:59 [GIT PULL nf-2.6] IPVS Simon Horman
@ 2011-03-01 22:59 ` Simon Horman
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2011-03-01 22:59 UTC (permalink / raw)
  To: lvs-devel, netdev, netfilter-devel, netfilter
  Cc: Hans Schillstrom, Julian Anastasov, Patrick McHardy, Simon Horman

From: Julian Anastasov <ja@ssi.bg>

	Fix dst_lock usage in __ip_vs_update_dest. We need
_bh locking because destination is updated in user context.
Can cause lockups on frequent destination updates.
Problem reported by Simon Kirby. Bug was introduced
in 2.6.37 from the "ipvs: changes for local real server"
change.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 net/netfilter/ipvs/ip_vs_ctl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 22f7ad5..ba98e13 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -808,9 +808,9 @@ __ip_vs_update_dest(struct ip_vs_service *svc, struct ip_vs_dest *dest,
 	dest->u_threshold = udest->u_threshold;
 	dest->l_threshold = udest->l_threshold;
 
-	spin_lock(&dest->dst_lock);
+	spin_lock_bh(&dest->dst_lock);
 	ip_vs_dst_reset(dest);
-	spin_unlock(&dest->dst_lock);
+	spin_unlock_bh(&dest->dst_lock);
 
 	if (add)
 		ip_vs_new_estimator(&dest->stats);
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-01 22:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-22  8:40 [PATCH] ipvs: fix dst_lock locking on dest update Julian Anastasov
2011-02-23  0:26 ` Simon Horman
  -- strict thread matches above, loose matches on Subject: below --
2011-02-22  9:11 Hans Schillstrom
2011-03-01 22:59 [GIT PULL nf-2.6] IPVS Simon Horman
2011-03-01 22:59 ` [PATCH] ipvs: fix dst_lock locking on dest update Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).