]> xenbits.xensource.com Git - xenclient/kernel.git/commitdiff
imported patch revert-linux-2.6-net-Fixing-bonding-rtnl_lock-screwups.patch revert-linux-2.6-xen-xennet-coordinate-arp-with-backend-network-status.patch
authort_jeang <devnull@localhost>
Tue, 6 Jan 2009 12:05:55 +0000 (12:05 +0000)
committert_jeang <devnull@localhost>
Tue, 6 Jan 2009 12:05:55 +0000 (12:05 +0000)
drivers/net/bonding/bond_sysfs.c

index b1f861f80a1aadce3059d66fce7ca6f2c886f5a9..dbd9b964da4111936d98bb2de01184883d50e6fe 100644 (file)
@@ -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. */