From patchwork Sun Nov 21 19:58:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 72455 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 14490B7152 for ; Mon, 22 Nov 2010 06:58:16 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755578Ab0KUT5v (ORCPT ); Sun, 21 Nov 2010 14:57:51 -0500 Received: from mail-ey0-f174.google.com ([209.85.215.174]:60108 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755471Ab0KUT5u (ORCPT ); Sun, 21 Nov 2010 14:57:50 -0500 Received: by eye27 with SMTP id 27so3558909eye.19 for ; Sun, 21 Nov 2010 11:57:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=JAgmgozGMvDtpYJeBnn4G6MdxRfkI0SzjcuCphSrgLs=; b=tzCG2ESUMpPOYaq9+IdXYhHpRPI7eSmtn+xFCHt/FhkMYTWDlzAl5/7OikPyGgTts5 IXNNMnHo7kqnwWhHRyauZOmnBWCHHMQmat7zCtCL3kuvkMojDtaTBPmxf1ORq6s3iKrl mgi42PM64UjEWU/qkcti6rmFzlPCbLrtj5GSs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=VLxz2yZ5rhAXCoHfIIuGT/KiSvRVHEUC7ri/uQTzJrY6dTtCCQhOcOkP906pUGDGHw ztEj+54x0DTj19gPxIExorCTp7soBWsvF1RkyediMoPXhDXg7dxoEcrEZ21yObJxb+f6 Yd9XlbFQI8vWdQPJVQR2rkhTnrM+9uo77gGT0= Received: by 10.14.47.197 with SMTP id t45mr3019958eeb.22.1290369466070; Sun, 21 Nov 2010 11:57:46 -0800 (PST) Received: from localhost ([212.98.177.195]) by mx.google.com with ESMTPS id v51sm3936433eeh.10.2010.11.21.11.57.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 21 Nov 2010 11:57:45 -0800 (PST) Date: Sun, 21 Nov 2010 21:58:05 +0200 From: Sergey Senozhatsky To: "David S. Miller" Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Pekka Savola (ipv6)" , Hideaki YOSHIFUJI Subject: [PATCH] ipv6: fix inet6_dev refcnt with IPV6_PRIVACY enabled Message-ID: <20101121195805.GA4068@swordfish> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When IPV6_PRIVACY is enabled, in ipv6_add_dev we have second extra in6_dev_hold while preparing to call ipv6_regen_rndid, and only one in6_dev_put call in addrconf_ifdown for inet6_dev devices with active regen_timer. That leaves inet6_dev with refcnt equals to 1 and blocks device unregistration: "unregister_netdevice: waiting for usb0 to become free. Usage count = 1" Signed-off-by: Sergey Senozhatsky --- net/ipv6/addrconf.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) -- 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 diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 2fc35b3..541f773 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -425,7 +425,6 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev) dev->name); ndev->cnf.use_tempaddr = -1; } else { - in6_dev_hold(ndev); ipv6_regen_rndid((unsigned long) ndev); } #endif