diff options
author | Jianlin Lv <Jianlin.Lv@arm.com> | 2021-03-14 22:56:29 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-15 12:40:01 -0700 |
commit | acdff0df54264d187b648b80bc18265f0698f1ad (patch) | |
tree | 5f097d2555a01bc176375c2b3346df8d32a95c6a | |
parent | 8f64860f8b567cc4f8ac854a65cbf6337404c520 (diff) |
bonding: Added -ENODEV interpret for slaves option
When the incorrect interface name is stored in the slaves/active_slave
option of the bonding sysfs, the kernel does not record the log that
interface does not exist.
This patch adds a log for -ENODEV error, which will facilitate users to
figure out such issue.
Signed-off-by: Jianlin Lv <Jianlin.Lv@arm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/bonding/bond_options.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c index 77d7c38bd435..c9d3604ae129 100644 --- a/drivers/net/bonding/bond_options.c +++ b/drivers/net/bonding/bond_options.c @@ -640,6 +640,15 @@ static void bond_opt_error_interpret(struct bonding *bond, netdev_err(bond->dev, "option %s: unable to set because the bond device is up\n", opt->name); break; + case -ENODEV: + if (val && val->string) { + p = strchr(val->string, '\n'); + if (p) + *p = '\0'; + netdev_err(bond->dev, "option %s: interface %s does not exist!\n", + opt->name, val->string); + } + break; default: break; } |