The pp->getprio was used
1) to store the prioritizer function pointer
2) to determine if the prioritizer was already selected
But NULL is a valid value for already selected getprio.
Which causes uneeded re-selection.
So introduce a pp->getprio_selected flag to straight this out.
Edward Goggin, EMC
pp->getuid = NULL;
pp->getprio = NULL;
pp->checkfn = NULL;
+ pp->getprio_selected = 0;
}
int
* get path prio
*/
if (mask & DI_PRIO) {
- if (!pp->getprio)
+ if (!pp->getprio_selected) {
select_getprio(pp);
-
+ pp->getprio_selected = 1;
+ }
if (!pp->getprio) {
pp->priority = 1;
} else if (apply_format(pp->getprio, &buff[0], pp)) {
int pgindex;
char * getuid;
char * getprio;
+ int getprio_selected;
int (*checkfn) (int, char *, void **);
void * checker_context;
struct multipath * mpp;
pp->checker_context = NULL;
pp->getuid = NULL;
pp->getprio = NULL;
+ pp->getprio_selected = 0;
if (pp->fd >= 0)
close(pp->fd);