From patchwork Mon Jan 21 20:48:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 214254 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 BE0592C007E for ; Tue, 22 Jan 2013 07:48:16 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756736Ab3AUUsH (ORCPT ); Mon, 21 Jan 2013 15:48:07 -0500 Received: from shards.monkeyblade.net ([149.20.54.216]:42822 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754306Ab3AUUsF (ORCPT ); Mon, 21 Jan 2013 15:48:05 -0500 Received: from localhost (nat-pool-rdu.redhat.com [66.187.233.202]) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 3D1C6584AD0; Mon, 21 Jan 2013 12:48:08 -0800 (PST) Date: Mon, 21 Jan 2013 15:48:03 -0500 (EST) Message-Id: <20130121.154803.1415897555788515730.davem@davemloft.net> To: PeterHuewe@gmx.de Cc: yoshfuji@linux-ipv6.org, fengguang.wu@intel.com, netdev@vger.kernel.org Subject: Re: Sparse Warnings: net/ipv6/route.c:521:17: sparse: context imbalance in 'rt6_probe' - different lock contexts for basic block From: David Miller In-Reply-To: <201301212103.18066.PeterHuewe@gmx.de> References: <201301212103.18066.PeterHuewe@gmx.de> X-Mailer: Mew version 6.5 on Emacs 24.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Peter Hüwe Date: Mon, 21 Jan 2013 21:03:17 +0100 > Hi YOSHIFUJI, > > FYI, there are new sparse warnings show up in > > tree: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git > branch: master > head: 887c95cc1da53f66a5890fdeab13414613010097 > commit: 2152caea719657579daa3a1a57a5425a3db6d612 [185/189] ipv6: Do not depend > on rt->n in rt6_probe(). > >>> net/ipv6/route.c:521:17: sparse: context imbalance in 'rt6_probe' - > different lock contexts for basic block > > On latest net-next/master it's > net/ipv6/route.c:500:17: warning: context imbalance in 'rt6_probe' - different > lock contexts for basic block > > > Reported-by: Fengguang Wu > Reported-by: Peter Huewe This is fixed by: commit b820bb6b996966d93a5442b5fbf803ea58e7f487 Author: YOSHIFUJI Hideaki / 吉藤英明 Date: Mon Jan 21 09:58:50 2013 +0000 ndisc: Do not try to update "updated" time if neighbour has already gone. Commit 2152caea ("ipv6: Do not depend on rt->n in rt6_probe().") introduce a bug to try to update "updated" time in neighbour structure. Update the "updated" time only if neighbour is available. Bug was found by Dan Carpenter Signed-off-by: YOSHIFUJI Hideaki Signed-off-by: David S. Miller diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 2d94d5a..f3328bc 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -492,10 +492,10 @@ static void rt6_probe(struct rt6_info *rt) struct in6_addr mcaddr; struct in6_addr *target; - neigh->updated = jiffies; - - if (neigh) + if (neigh) { + neigh->updated = jiffies; write_unlock(&neigh->lock); + } target = (struct in6_addr *)&rt->rt6i_gateway; addrconf_addr_solict_mult(target, &mcaddr);