53 lines
1.6 KiB
Diff
53 lines
1.6 KiB
Diff
|
---
|
||
|
multipathd/main.c | 20 ++++++--------------
|
||
|
1 file changed, 6 insertions(+), 14 deletions(-)
|
||
|
|
||
|
Index: multipath-tools/multipathd/main.c
|
||
|
===================================================================
|
||
|
--- multipath-tools.orig/multipathd/main.c
|
||
|
+++ multipath-tools/multipathd/main.c
|
||
|
@@ -965,6 +965,7 @@ check_path (struct vectors * vecs, struc
|
||
|
{
|
||
|
int newstate;
|
||
|
int oldpriority;
|
||
|
+ int new_path_up = 0;
|
||
|
|
||
|
if (!pp->mpp)
|
||
|
return;
|
||
|
@@ -1033,16 +1034,7 @@ check_path (struct vectors * vecs, struc
|
||
|
else
|
||
|
reinstate_path(pp, 0);
|
||
|
|
||
|
- /*
|
||
|
- * schedule [defered] failback
|
||
|
- */
|
||
|
- if (pp->mpp->pgfailback > 0)
|
||
|
- pp->mpp->failback_tick =
|
||
|
- pp->mpp->pgfailback + 1;
|
||
|
- else if (need_switch_pathgroup(pp->mpp, 1) &&
|
||
|
- (pp->mpp->pgfailback == -FAILBACK_IMMEDIATE ||
|
||
|
- followover_should_failback(pp)))
|
||
|
- switch_pathgroup(pp->mpp);
|
||
|
+ new_path_up = 1;
|
||
|
|
||
|
/*
|
||
|
* if at least one path is up in a group, and
|
||
|
@@ -1080,13 +1072,13 @@ check_path (struct vectors * vecs, struc
|
||
|
if (pp->priority != oldpriority &&
|
||
|
pp->mpp->pgpolicyfn == (pgpolicyfn *)group_by_prio)
|
||
|
update_path_groups(pp->mpp, vecs);
|
||
|
- else if (need_switch_pathgroup(pp->mpp, 0)) {
|
||
|
+ else if (need_switch_pathgroup(pp->mpp, new_path_up)) {
|
||
|
if (pp->mpp->pgfailback > 0 &&
|
||
|
- pp->mpp->failback_tick <= 0)
|
||
|
+ (new_path_up || pp->mpp->failback_tick <= 0))
|
||
|
pp->mpp->failback_tick =
|
||
|
pp->mpp->pgfailback + 1;
|
||
|
- else if (pp->mpp->pgfailback ==
|
||
|
- -FAILBACK_IMMEDIATE)
|
||
|
+ else if (pp->mpp->pgfailback == -FAILBACK_IMMEDIATE ||
|
||
|
+ (new_path_up && followover_should_failback(pp)))
|
||
|
switch_pathgroup(pp->mpp);
|
||
|
}
|
||
|
}
|