netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2] bonding: check slave set command firstly
@ 2019-02-11 18:49 xiangxia.m.yue
  2019-02-14 16:36 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: xiangxia.m.yue @ 2019-02-11 18:49 UTC (permalink / raw)
  To: davem; +Cc: netdev, Tonghao Zhang

From: Tonghao Zhang <xiangxia.m.yue@gmail.com>

This patch is a little improvement. If user use the
command shown as below, we should print the info [1]
instead of [2]. The eth0 exists actually, and it may
confuse user.

$ echo "eth0" > /sys/class/net/bond4/bonding/slaves

[1] "bond4: no command found in slaves file - use +ifname or -ifname"
[2] "write error: No such device"

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
---
v2: fix compiling warning.
---
 drivers/net/bonding/bond_options.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index 4d5d01c..da1fc17 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -1375,6 +1375,7 @@ static int bond_option_slaves_set(struct bonding *bond,
 	sscanf(newval->string, "%16s", command); /* IFNAMSIZ*/
 	ifname = command + 1;
 	if ((strlen(command) <= 1) ||
+	    (command[0] != '+' && command[0] != '-') ||
 	    !dev_valid_name(ifname))
 		goto err_no_cmd;
 
@@ -1398,6 +1399,7 @@ static int bond_option_slaves_set(struct bonding *bond,
 		break;
 
 	default:
+		/* should not run here. */
 		goto err_no_cmd;
 	}
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] bonding: check slave set command firstly
  2019-02-11 18:49 [PATCH net-next v2] bonding: check slave set command firstly xiangxia.m.yue
@ 2019-02-14 16:36 ` David Miller
  2019-02-15  1:44   ` Tonghao Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2019-02-14 16:36 UTC (permalink / raw)
  To: xiangxia.m.yue; +Cc: netdev

From: xiangxia.m.yue@gmail.com
Date: Mon, 11 Feb 2019 10:49:48 -0800

> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> 
> This patch is a little improvement. If user use the
> command shown as below, we should print the info [1]
> instead of [2]. The eth0 exists actually, and it may
> confuse user.
> 
> $ echo "eth0" > /sys/class/net/bond4/bonding/slaves
> 
> [1] "bond4: no command found in slaves file - use +ifname or -ifname"
> [2] "write error: No such device"
> 
> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>

Applied, but would you please fix the dates on your submissions?

Because the dates in your patch postings are in the past, patchwork
puts your work at the tail of my patch queue instead of the front.

Thank you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] bonding: check slave set command firstly
  2019-02-14 16:36 ` David Miller
@ 2019-02-15  1:44   ` Tonghao Zhang
  2019-02-15  1:53     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Tonghao Zhang @ 2019-02-15  1:44 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Kernel Network Developers

On Fri, Feb 15, 2019 at 12:36 AM David Miller <davem@davemloft.net> wrote:
>
> From: xiangxia.m.yue@gmail.com
> Date: Mon, 11 Feb 2019 10:49:48 -0800
>
> > From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> >
> > This patch is a little improvement. If user use the
> > command shown as below, we should print the info [1]
> > instead of [2]. The eth0 exists actually, and it may
> > confuse user.
> >
> > $ echo "eth0" > /sys/class/net/bond4/bonding/slaves
> >
> > [1] "bond4: no command found in slaves file - use +ifname or -ifname"
> > [2] "write error: No such device"
> >
> > Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>
> Applied, but would you please fix the dates on your submissions?
>
> Because the dates in your patch postings are in the past, patchwork
> puts your work at the tail of my patch queue instead of the front.
OK, I format the patch a few days ago, but send it yesterday.
> Thank you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] bonding: check slave set command firstly
  2019-02-15  1:44   ` Tonghao Zhang
@ 2019-02-15  1:53     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-02-15  1:53 UTC (permalink / raw)
  To: xiangxia.m.yue; +Cc: netdev

From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Date: Fri, 15 Feb 2019 09:44:58 +0800

> OK, I format the patch a few days ago, but send it yesterday.

Just FYI, you can use various options to git such that it composes the
email using the current time rather than the date in the commit
itself.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-15  1:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-11 18:49 [PATCH net-next v2] bonding: check slave set command firstly xiangxia.m.yue
2019-02-14 16:36 ` David Miller
2019-02-15  1:44   ` Tonghao Zhang
2019-02-15  1:53     ` David Miller

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).