netdev
[Top] [All Lists]

Re: Possible race/deadlock in netdev_unregister

To: Daniele Orlandi <daniele@xxxxxxxxxxx>
Subject: Re: Possible race/deadlock in netdev_unregister
From: Stephen Hemminger <shemminger@xxxxxxxx>
Date: Fri, 28 Jan 2005 15:38:06 -0800
Cc: netdev@xxxxxxxxxxx
In-reply-to: <200501282313.30517.daniele@xxxxxxxxxxx>
Organization: Open Source Development Lab
References: <200501282313.30517.daniele@xxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Fri, 28 Jan 2005 23:13:29 +0100
Daniele Orlandi <daniele@xxxxxxxxxxx> wrote:

> 
> Hello,
> 
> First of all, please excuse me if this happens to be a bug in my code :)
> Unfortunately I'm still a newbie with netdev and his interactions with 
> netlink, hotplug, etc... please help me understand what's happening and who 
> is wrong.
> 
> The scenario is this:
> 
> - A device driver module (written by me) has two netdevices registered.
> - Another module (written by me, too) provides sockets implementation for the 
> protocol spoken by the device.
> - An application has one socket bound to one netdevice
> - I rmmod the device driver module
> - The exit function in the module calls netdev_unregister
> - The event dispatcher notifies the socket layer that a device is going down
> - The socket is marked errored but the application keeps it open for a while
> - The application ends, the socket is destroyed, the remaining reference to 
> netdevice is released but netdev_unregister keeps sleeping forever with this 
> backtrace:

You are probably self-deadlocking on the netlink mutex (rtnl).
Is your netdevice_notifier handler calling rtnl_lock?


<Prev in Thread] Current Thread [Next in Thread>