From: Jiri Pirko Date: Thu, 10 Oct 2019 13:18:48 +0000 (+0200) Subject: devlink: don't do reporter recovery if the state is healthy X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=402818205c9ecdfd922fdfa58fb113f60fdda523;p=linux.git devlink: don't do reporter recovery if the state is healthy If reporter state is healthy, don't call into a driver for recover and don't increase recovery count. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller --- diff --git a/net/core/devlink.c b/net/core/devlink.c index eb0a22f058874..95887462eecfb 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -4851,6 +4851,9 @@ devlink_health_reporter_recover(struct devlink_health_reporter *reporter, { int err; + if (reporter->health_state == DEVLINK_HEALTH_REPORTER_STATE_HEALTHY) + return 0; + if (!reporter->ops->recover) return -EOPNOTSUPP;