From 0256ba48cd2e8e7bd68bcbea5be84133f791b897 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Mar 18 2021 04:20:00 +0000 Subject: Apply patch 0044-libmultipath-don-t-dlclose-tur-checker-DSO.patch patch_name: 0044-libmultipath-don-t-dlclose-tur-checker-DSO.patch present_in_specfile: true location_in_specfile: 44 --- diff --git a/libmultipath/checkers.c b/libmultipath/checkers.c index 8d2be8a..6359e5d 100644 --- a/libmultipath/checkers.c +++ b/libmultipath/checkers.c @@ -21,6 +21,7 @@ struct checker_class { void (*reset)(void); /* to reset the global variables */ const char **msgtable; short msgtable_size; + int keep_dso; }; char *checker_state_names[] = { @@ -69,7 +70,7 @@ void free_checker_class(struct checker_class *c) list_del(&c->node); if (c->reset) c->reset(); - if (c->handle) { + if (c->handle && !c->keep_dso) { if (dlclose(c->handle) != 0) { condlog(0, "Cannot unload checker %s: %s", c->name, dlerror()); @@ -192,6 +193,13 @@ out: return NULL; } +void checker_keep_dso(struct checker * c) +{ + if (!c || !c->cls) + return; + c->cls->keep_dso = 1; +} + void checker_set_fd (struct checker * c, int fd) { if (!c) diff --git a/libmultipath/checkers.h b/libmultipath/checkers.h index b458118..f183cff 100644 --- a/libmultipath/checkers.h +++ b/libmultipath/checkers.h @@ -145,6 +145,7 @@ void checker_reset (struct checker *); void checker_set_sync (struct checker *); void checker_set_async (struct checker *); void checker_set_fd (struct checker *, int); +void checker_keep_dso(struct checker *c); void checker_enable (struct checker *); void checker_disable (struct checker *); int checker_check (struct checker *, int); diff --git a/libmultipath/checkers/tur.c b/libmultipath/checkers/tur.c index e886fcf..fd58d62 100644 --- a/libmultipath/checkers/tur.c +++ b/libmultipath/checkers/tur.c @@ -394,6 +394,7 @@ int libcheck_check(struct checker * c) uatomic_set(&ct->running, 1); tur_set_async_timeout(c); setup_thread_attr(&attr, 32 * 1024, 1); + checker_keep_dso(c); r = pthread_create(&ct->thread, &attr, tur_thread, ct); pthread_attr_destroy(&attr); if (r) {