提交 bea0c5c9 编写于 作者: A Aya Levin 提交者: David S. Miller

devlink: Fix reporter's recovery condition

Devlink health core conditions the reporter's recovery with the
expiration of the grace period. This is not relevant for the first
recovery. Explicitly demand that the grace period will only apply to
recoveries other than the first.

Fixes: c8e1da0b ("devlink: Add health report functionality")
Signed-off-by: NAya Levin <ayal@mellanox.com>
Reviewed-by: NMoshe Shemesh <moshe@mellanox.com>
Reviewed-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f42234ff
...@@ -5368,6 +5368,7 @@ int devlink_health_report(struct devlink_health_reporter *reporter, ...@@ -5368,6 +5368,7 @@ int devlink_health_report(struct devlink_health_reporter *reporter,
{ {
enum devlink_health_reporter_state prev_health_state; enum devlink_health_reporter_state prev_health_state;
struct devlink *devlink = reporter->devlink; struct devlink *devlink = reporter->devlink;
unsigned long recover_ts_threshold;
/* write a log message of the current error */ /* write a log message of the current error */
WARN_ON(!msg); WARN_ON(!msg);
...@@ -5378,10 +5379,12 @@ int devlink_health_report(struct devlink_health_reporter *reporter, ...@@ -5378,10 +5379,12 @@ int devlink_health_report(struct devlink_health_reporter *reporter,
devlink_recover_notify(reporter, DEVLINK_CMD_HEALTH_REPORTER_RECOVER); devlink_recover_notify(reporter, DEVLINK_CMD_HEALTH_REPORTER_RECOVER);
/* abort if the previous error wasn't recovered */ /* abort if the previous error wasn't recovered */
recover_ts_threshold = reporter->last_recovery_ts +
msecs_to_jiffies(reporter->graceful_period);
if (reporter->auto_recover && if (reporter->auto_recover &&
(prev_health_state != DEVLINK_HEALTH_REPORTER_STATE_HEALTHY || (prev_health_state != DEVLINK_HEALTH_REPORTER_STATE_HEALTHY ||
jiffies - reporter->last_recovery_ts < (reporter->last_recovery_ts && reporter->recovery_count &&
msecs_to_jiffies(reporter->graceful_period))) { time_is_after_jiffies(recover_ts_threshold)))) {
trace_devlink_health_recover_aborted(devlink, trace_devlink_health_recover_aborted(devlink,
reporter->ops->name, reporter->ops->name,
reporter->health_state, reporter->health_state,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册