netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] netdev sysfs failure handling
@ 2006-04-21 20:42 Stephen Hemminger
  2006-05-07  1:06 ` David S. Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Hemminger @ 2006-04-21 20:42 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

In case of sysfs failure, don't let device be brought up.
It can be cleared by unregister_netdevice so module can be unloaded
normally.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

--- sky2-2.6.17.orig/net/core/dev.c	2006-04-21 12:21:45.000000000 -0700
+++ sky2-2.6.17/net/core/dev.c	2006-04-21 12:46:48.000000000 -0700
@@ -3043,10 +3043,17 @@
 
 		switch(dev->reg_state) {
 		case NETREG_REGISTERING:
+			/* Can't do proper error handling here because
+			 * this is a delayed call after register_netdevice
+			 * so no way to tell device driver what is wrong.
+			 */
 			err = netdev_register_sysfs(dev);
-			if (err)
+			if (err) {
 				printk(KERN_ERR "%s: failed sysfs registration (%d)\n",
 				       dev->name, err);
+				/* Don't let device be brought up */
+				clear_bit(__LINK_STATE_PRESENT, &dev->state);
+			}
 			dev->reg_state = NETREG_REGISTERED;
 			break;
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-05-09 22:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-21 20:42 [RFC] netdev sysfs failure handling Stephen Hemminger
2006-05-07  1:06 ` David S. Miller
2006-05-09 19:01   ` Stephen Hemminger
2006-05-09 21:05     ` David S. Miller
2006-05-09 21:40       ` Stephen Hemminger
2006-05-09 22:43         ` David S. Miller
2006-05-09 22:50           ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).