From patchwork Tue Feb 22 08:40:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Anastasov X-Patchwork-Id: 83934 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 96BE8B70CC for ; Tue, 22 Feb 2011 19:36:49 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752582Ab1BVIgo (ORCPT ); Tue, 22 Feb 2011 03:36:44 -0500 Received: from ja.ssi.bg ([178.16.129.10]:38335 "EHLO ja.ssi.bg" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752436Ab1BVIgn (ORCPT ); Tue, 22 Feb 2011 03:36:43 -0500 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by ja.ssi.bg (8.14.4/8.14.4) with ESMTP id p1M8ePlV020993; Tue, 22 Feb 2011 10:40:25 +0200 Date: Tue, 22 Feb 2011 10:40:25 +0200 (EET) From: Julian Anastasov To: "David S. Miller" cc: netdev@vger.kernel.org, lvs-devel@vger.kernel.org, Simon Horman Subject: [PATCH] ipvs: fix dst_lock locking on dest update Message-ID: User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Acked-by: Simon Horman --- 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. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 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);