Re: bug in /net/core/dev.c

From: DJBARROW@de.ibm.com
Date: Tue Jun 12 2001 - 09:17:48 EST


Hi Alan/Dave
Here is a better version of the patch I think it cuts about 15 lines out of
dev.c & I think logically it is more bulletproof than my previous attempt.

(See attached file: dev.c.2.4.5.v2.patch)

Hi Dave,

On 390 it is very easy to hotplug devices under VM.

We do it all the time using the channel device layer on s/390, so users
can reconfigure devices if they misconfigure them.

If it can be registered it should be able to be unregistered.

Cornelia Huck in our group in boeblingen noticed the bug too.

Please respond to "David S. Miller" <davem@redhat.com>

To: Denis Joseph Barrow/Germany/Contr/IBM@IBMDE
cc: linux-kernel@vger.kernel.org
Subject: Re: bug in /net/core/dev.c

DJBARROW@de.ibm.com writes:
> The dev->refcnt will go up to 2 ( it should be 1) unregister_netdevice
will
> usually loop forever
> waiting for the refcnt to drop to 1 when an attempt to unregister is
done.

When will devices built statically into the kernel ever be
unregister'd?

Later,
David S. Miller
davem@redhat.com

Hi,
I found this bug in dev.c

It happens if register_netdevice is called before net_dev_init which can
happen from init functions,
when device drivers are compiled into the kernel.

The dev->refcnt will go up to 2 ( it should be 1) unregister_netdevice will
usually loop forever
waiting for the refcnt to drop to 1 when an attempt to unregister is done.

The printk in the bootmessages early initialization of device <blah> is
deferred is evidence of this behaviour occuring.

The small patch is below ,hope it is okay for you.



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 15 2001 - 21:00:14 EST