netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jpirko@redhat.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, fubar@us.ibm.com,
	bonding-devel@lists.sourceforge.net
Subject: Re: [PATCH net-next-2.6] bonding: remove redundant checks from bonding_store_slaves
Date: Tue, 18 May 2010 14:23:13 +0200	[thread overview]
Message-ID: <20100518122312.GC2878@psychotron.lab.eng.brq.redhat.com> (raw)
In-Reply-To: <20100518120944.GA2878@psychotron.lab.eng.brq.redhat.com>

Please scratch this one too, will repost it after I post 2nd version of
"[PATCH net-next-2.6] bonding: move slave MTU handling from sysfs"

Thanks, Jirka

Tue, May 18, 2010 at 02:09:45PM CEST, jpirko@redhat.com wrote:
>Remove checks that duplicates similar checks in bond_enslave.
>
>Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>
>diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
>index 4e84cfc..6c44c07 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

      reply	other threads:[~2010-05-18 12:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-18 12:09 [PATCH net-next-2.6] bonding: remove redundant checks from bonding_store_slaves Jiri Pirko
2010-05-18 12:23 ` Jiri Pirko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100518122312.GC2878@psychotron.lab.eng.brq.redhat.com \
    --to=jpirko@redhat.com \
    --cc=bonding-devel@lists.sourceforge.net \
    --cc=davem@davemloft.net \
    --cc=fubar@us.ibm.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).