diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-05-18 01:44:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-02 06:39:42 -0400 |
commit | 3dd90905e08655aa7754f08ebe8b1f44e2793074 (patch) | |
tree | 48261f1ff95d6483d13caa922afe0256f19961ee /drivers/net/bonding | |
parent | b15ba0fbdc2e54c3885fed91c54aeef7fe474033 (diff) |
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.c | 20 |
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, | |||
243 | 243 | ||
244 | if (command[0] == '+') { | 244 | if (command[0] == '+') { |
245 | 245 | ||
246 | /* Got a slave name in ifname. Is it already in the list? */ | 246 | /* Got a slave name in ifname. */ |
247 | 247 | ||
248 | dev = __dev_get_by_name(dev_net(bond->dev), ifname); | 248 | dev = __dev_get_by_name(dev_net(bond->dev), ifname); |
249 | if (!dev) { | 249 | if (!dev) { |
@@ -253,24 +253,6 @@ static ssize_t bonding_store_slaves(struct device *d, | |||
253 | goto out; | 253 | goto out; |
254 | } | 254 | } |
255 | 255 | ||
256 | if (dev->flags & IFF_UP) { | ||
257 | pr_err("%s: Error: Unable to enslave %s because it is already up.\n", | ||
258 | bond->dev->name, dev->name); | ||
259 | ret = -EPERM; | ||
260 | goto out; | ||
261 | } | ||
262 | |||
263 | read_lock(&bond->lock); | ||
264 | bond_for_each_slave(bond, slave, i) | ||
265 | if (slave->dev == dev) { | ||
266 | pr_err("%s: Interface %s is already enslaved!\n", | ||
267 | bond->dev->name, ifname); | ||
268 | ret = -EPERM; | ||
269 | read_unlock(&bond->lock); | ||
270 | goto out; | ||
271 | } | ||
272 | read_unlock(&bond->lock); | ||
273 | |||
274 | pr_info("%s: Adding slave %s.\n", bond->dev->name, ifname); | 256 | pr_info("%s: Adding slave %s.\n", bond->dev->name, ifname); |
275 | 257 | ||
276 | /* If this is the first slave, then we need to set | 258 | /* If this is the first slave, then we need to set |