From patchwork Thu Jun 7 09:12:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 163550 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 265D2B6FF7 for ; Thu, 7 Jun 2012 19:12:34 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760269Ab2FGJMc (ORCPT ); Thu, 7 Jun 2012 05:12:32 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:63691 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751176Ab2FGJMb (ORCPT ); Thu, 7 Jun 2012 05:12:31 -0400 Received: by eaak11 with SMTP id k11so126076eaa.19 for ; Thu, 07 Jun 2012 02:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; bh=yYMLnBsPtjcombTRRVvpM6ZZmeldMQq3/Z8YLA+olIk=; b=h1u99spA+zVEeehNF2/yG3HqGBeOvnUJGShatncijMLsp+21MmXnyboFTnCZr87vMi 9IYt0yb3097aX75A4TGlido4TWAUhuKhFz4VEzxqiNPdL6dfHWpBcaJ3bdIvcrT2NstR FOgek0S+HeeUbCpvIYpvJY6B8P4fb0MXr60UHlyfkHKmDDhkTu9vSsISjSr1ROpvqttI jrikCJzZuQKaxSlWLXXql25w7YHZACRBjkKa30wXpeU5KQKUsP/oXW63SDCsLRWa0dbD Takr7vyHeG24uqUen8SwjT/mFhDRTlmWm98dT9BzTYFV1cYAFLmsB0eKpSuKxvooP674 Idpg== Received: by 10.14.186.14 with SMTP id v14mr757191eem.49.1339060349867; Thu, 07 Jun 2012 02:12:29 -0700 (PDT) Received: from [192.168.202.172] ([74.125.121.33]) by mx.google.com with ESMTPS id x52sm8540110eea.11.2012.06.07.02.12.27 (version=SSLv3 cipher=OTHER); Thu, 07 Jun 2012 02:12:28 -0700 (PDT) Subject: Re: BUG, 3.4.1, l2tp, kernel panic on rmmod l2tp_eth From: Eric Dumazet To: Denys Fedoryshchenko Cc: netdev@vger.kernel.org In-Reply-To: <61a2ca9cc47a9a9a1c8a36738090dbf9@visp.net.lb> References: <61a2ca9cc47a9a9a1c8a36738090dbf9@visp.net.lb> Date: Thu, 07 Jun 2012 11:12:26 +0200 Message-ID: <1339060346.26966.106.camel@edumazet-glaptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 2012-06-07 at 11:31 +0300, Denys Fedoryshchenko wrote: > Hi > > Sorry for weird looking message, but this is how i got it over > netconsole > > If i have any tunnel+session configured and up and will do rmmod > l2tp_eth, > i will get panic, after my userspace program will fetch interfaces > information (over netlink). > > Probably it should not rmmod if there is tunnels configured? Sure, can you try the following patch ? --- 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/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c index 443591d..185f12f 100644 --- a/net/l2tp/l2tp_eth.c +++ b/net/l2tp/l2tp_eth.c @@ -162,6 +162,7 @@ static void l2tp_eth_delete(struct l2tp_session *session) if (dev) { unregister_netdev(dev); spriv->dev = NULL; + module_put(THIS_MODULE); } } } @@ -249,6 +250,7 @@ static int l2tp_eth_create(struct net *net, u32 tunnel_id, u32 session_id, u32 p if (rc < 0) goto out_del_dev; + __module_get(THIS_MODULE); /* Must be done after register_netdev() */ strlcpy(session->ifname, dev->name, IFNAMSIZ);