Patchwork [net-next,1/3] teamd: don't print warn message on -ESRCH during event send

login
register
mail settings
Submitter Jiri Pirko
Date Aug. 23, 2012, 1:26 p.m.
Message ID <1345728413-10298-2-git-send-email-jiri@resnulli.us>
Download mbox | patch
Permalink /patch/179651/
State Accepted
Delegated to: David Miller
Headers show

Comments

Jiri Pirko - Aug. 23, 2012, 1:26 p.m.
When no one is listening on NL socket, -ESRCH is returned and warning
message is printed. This message is confusing people and in fact has no
meaning. So do not print it in this case.

Reported-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
 drivers/net/team/team.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Jiri Pirko - Aug. 23, 2012, 1:31 p.m.
Oups. Subject should start with "team:" without "d" :(

David, should I repost?

Thu, Aug 23, 2012 at 03:26:51PM CEST, jiri@resnulli.us wrote:
>When no one is listening on NL socket, -ESRCH is returned and warning
>message is printed. This message is confusing people and in fact has no
>meaning. So do not print it in this case.
>
>Reported-by: Or Gerlitz <ogerlitz@mellanox.com>
>Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>---
> drivers/net/team/team.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
>index 17ce11b..4010bcd 100644
>--- a/drivers/net/team/team.c
>+++ b/drivers/net/team/team.c
>@@ -2487,7 +2487,7 @@ static void __team_options_change_check(struct team *team)
> 			list_add_tail(&opt_inst->tmp_list, &sel_opt_inst_list);
> 	}
> 	err = team_nl_send_event_options_get(team, &sel_opt_inst_list);
>-	if (err)
>+	if (err && err != -ESRCH)
> 		netdev_warn(team->dev, "Failed to send options change via netlink (err %d)\n",
> 			    err);
> }
>@@ -2518,9 +2518,9 @@ static void __team_port_change_check(struct team_port *port, bool linkup)
> 
> send_event:
> 	err = team_nl_send_event_port_list_get(port->team);
>-	if (err)
>-		netdev_warn(port->team->dev, "Failed to send port change of device %s via netlink\n",
>-			    port->dev->name);
>+	if (err && err != -ESRCH)
>+		netdev_warn(port->team->dev, "Failed to send port change of device %s via netlink (err %d)\n",
>+			    port->dev->name, err);
> 
> }
> 
>-- 
>1.7.11.4
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 17ce11b..4010bcd 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -2487,7 +2487,7 @@  static void __team_options_change_check(struct team *team)
 			list_add_tail(&opt_inst->tmp_list, &sel_opt_inst_list);
 	}
 	err = team_nl_send_event_options_get(team, &sel_opt_inst_list);
-	if (err)
+	if (err && err != -ESRCH)
 		netdev_warn(team->dev, "Failed to send options change via netlink (err %d)\n",
 			    err);
 }
@@ -2518,9 +2518,9 @@  static void __team_port_change_check(struct team_port *port, bool linkup)
 
 send_event:
 	err = team_nl_send_event_port_list_get(port->team);
-	if (err)
-		netdev_warn(port->team->dev, "Failed to send port change of device %s via netlink\n",
-			    port->dev->name);
+	if (err && err != -ESRCH)
+		netdev_warn(port->team->dev, "Failed to send port change of device %s via netlink (err %d)\n",
+			    port->dev->name, err);
 
 }