If a the tur checker creates a new context because an old thread is
still running, but the old thread finishes before the checker drops
the old context, the checker should reset nr_timeouts to 0, since
the old thread did complete in time.

Signed-off-by: Benjamin Marzinski <bmarz...@redhat.com>
---
 libmultipath/checkers/tur.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libmultipath/checkers/tur.c b/libmultipath/checkers/tur.c
index a19becf5..fe6a2f14 100644
--- a/libmultipath/checkers/tur.c
+++ b/libmultipath/checkers/tur.c
@@ -406,9 +406,11 @@ int libcheck_check(struct checker * c)
                        }
                        ((struct tur_checker_context *)c->context)->nr_timeouts 
= ct->nr_timeouts;
 
-                       if (!uatomic_sub_return(&ct->holders, 1))
+                       if (!uatomic_sub_return(&ct->holders, 1)) {
                                /* It did terminate, eventually */
                                cleanup_context(ct);
+                               ((struct tur_checker_context 
*)c->context)->nr_timeouts = 0;
+                       }
 
                        ct = c->context;
                } else
-- 
2.17.2

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel

Reply via email to