From: t_jeang Date: Tue, 6 Jan 2009 12:05:55 +0000 (+0000) Subject: imported patch revert-linux-2.6-net-Fixing-bonding-rtnl_lock-screwups.patch X-Git-Tag: revert-linux-2.6-xen-xennet-coordinate-arp-with-backend-network-status.patch X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=91416ca9d4e68eb4e0bfad89dba8a816da09443f;p=xenclient%2Fkernel.git imported patch revert-linux-2.6-net-Fixing-bonding-rtnl_lock-screwups.patch --- diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index b1f861f8..dbd9b964 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c @@ -147,29 +147,29 @@ static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t ": Unable remove bond %s due to open references.\n", ifname); res = -EPERM; - goto out_unlock; + goto out; } printk(KERN_INFO DRV_NAME ": %s is being deleted...\n", bond->dev->name); bond_destroy(bond); - goto out_unlock; + up_write(&bonding_rwsem); + rtnl_unlock(); + goto out; } printk(KERN_ERR DRV_NAME ": unable to delete non-existent bond %s\n", ifname); res = -ENODEV; - goto out_unlock; + up_write(&bonding_rwsem); + rtnl_unlock(); + goto out; } err_no_cmd: printk(KERN_ERR DRV_NAME ": no command found in bonding_masters. Use +ifname or -ifname.\n"); - return -EPERM; - -out_unlock: - up_write(&bonding_rwsem); - rtnl_unlock(); + res = -EPERM; /* Always return either count or an error. If you return 0, you'll * get called forever, which is bad. @@ -254,8 +254,8 @@ static ssize_t bonding_store_slaves(struct class_device *cd, const char *buffer, printk(KERN_ERR DRV_NAME ": %s: Unable to update slaves because interface is down.\n", bond->dev->name); - /* early return before rtnl_lock() */ - return -EPERM; + ret = -EPERM; + goto out; } /* Note: We can't hold bond->lock here, as bond_create grabs it. */