multipathd: reset delay_wait_checks counter on failure
authorMartin Wilck <mwilck@suse.com>
Tue, 13 Nov 2018 21:30:52 +0000 (22:30 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 14 Nov 2018 07:28:20 +0000 (08:28 +0100)
If path reinstantiation is delayed by delay_wait_checks, wait_checks
is counting down, the path fails during the delay phase, and then
comes up again, the wait_check counter starts counting down at the
same value where it previously stopped, which may be very low (even 1).

To avoid that, reset the counter to pp->delay_wait_checks if a failure
is encountered during the delay phase.

Signed-off-by: Martin Wilck <mwilck@suse.com>
multipathd/main.c

index 7fc97ba..cc555bb 100644 (file)
@@ -2041,8 +2041,12 @@ check_path (struct vectors * vecs, struct path * pp, int ticks)
                                        pp->wait_checks = pp->mpp->delay_wait_checks;
                                        pp->watch_checks = 0;
                                }
-                       }else
+                       } else {
                                fail_path(pp, 0);
+                               if (pp->wait_checks > 0)
+                                       pp->wait_checks =
+                                               pp->mpp->delay_wait_checks;
+                       }
 
                        /*
                         * cancel scheduled failback