summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2010-05-18 05:44:53 +0000
committerDavid S. Miller <davem@davemloft.net>2010-06-02 03:39:42 -0700
commit3dd90905e08655aa7754f08ebe8b1f44e2793074 (patch)
tree48261f1ff95d6483d13caa922afe0256f19961ee /drivers/net/bonding
parentb15ba0fbdc2e54c3885fed91c54aeef7fe474033 (diff)
downloadlinux-3dd90905e08655aa7754f08ebe8b1f44e2793074.tar.bz2
bonding: remove redundant checks from bonding_store_slaves V2
(it's actually the same as v1) Remove checks that duplicates similar checks in bond_enslave. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_sysfs.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 29a7a8a6d16f..79114386e686 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -243,7 +243,7 @@ static ssize_t bonding_store_slaves(struct device *d,
if (command[0] == '+') {
- /* Got a slave name in ifname. Is it already in the list? */
+ /* Got a slave name in ifname. */
dev = __dev_get_by_name(dev_net(bond->dev), ifname);
if (!dev) {
@@ -253,24 +253,6 @@ static ssize_t bonding_store_slaves(struct device *d,
goto out;
}
- if (dev->flags & IFF_UP) {
- pr_err("%s: Error: Unable to enslave %s because it is already up.\n",
- bond->dev->name, dev->name);
- ret = -EPERM;
- goto out;
- }
-
- read_lock(&bond->lock);
- bond_for_each_slave(bond, slave, i)
- if (slave->dev == dev) {
- pr_err("%s: Interface %s is already enslaved!\n",
- bond->dev->name, ifname);
- ret = -EPERM;
- read_unlock(&bond->lock);
- goto out;
- }
- read_unlock(&bond->lock);
-
pr_info("%s: Adding slave %s.\n", bond->dev->name, ifname);
/* If this is the first slave, then we need to set