When ni is flagged with "fatal_error" by LND, its health score
remains unaffected. This allows for the net containing such ni
to be selected for tx even if it is the only ni in this net.
Take "fatal_error" status of the ni into account when calculating
the net health score.
Test-Parameters: trivial
Signed-off-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Change-Id: Ib76245f835f1458873f0c05ad9b6727d295857de
Reviewed-on: https://review.whamcloud.com/43962
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Cyril Bordage <cbordage@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
{
struct lnet_ni *ni;
int best_healthv = 0;
{
struct lnet_ni *ni;
int best_healthv = 0;
list_for_each_entry(ni, &net->net_ni_list, ni_netlist) {
healthv = atomic_read(&ni->ni_healthv);
list_for_each_entry(ni, &net->net_ni_list, ni_netlist) {
healthv = atomic_read(&ni->ni_healthv);
- if (healthv > best_healthv)
+ ni_fatal = atomic_read(&ni->ni_fatal_error_on);
+ if (!ni_fatal && healthv > best_healthv)
best_healthv = healthv;
}
best_healthv = healthv;
}