]> git.baikalelectronics.ru Git - kernel.git/commit
devlink: Update reporter state to error even if recover aborted
authorEran Ben Elisha <eranbe@mellanox.com>
Sun, 3 Mar 2019 08:57:29 +0000 (10:57 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Mar 2019 19:00:43 +0000 (11:00 -0800)
commit525fdef013c8c3aa9812471db60fd203d7280c85
tree73c814f8a69845f475f7a75df251616d5df8b6cc
parent3fdd843f2e2ac4dcabf83a97750a9b7ae5dd74f2
devlink: Update reporter state to error even if recover aborted

If devlink_health_report() aborted the recover flow due to grace period checker,
it left the reporter status as DEVLINK_HEALTH_REPORTER_STATE_HEALTHY, which is
a bug. Fix that by always setting the reporter state to
DEVLINK_HEALTH_REPORTER_STATE_ERROR prior to running the checker mentioned above.

In addition, save the previous health_state in a temporary variable, then use
it in the abort check comparison instead of using reporter->health_state which
might be already changed.

Fixes: 57dee9c5550e ("devlink: Add health report functionality")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/devlink.c