Commit 96e2a95e authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Avoid taking the saintmode lock if the list empty.

Submitted by:	DocWilco
parent c082835a
...@@ -261,16 +261,15 @@ vbe_Healthy(const struct vdi_simple *vs, const struct sess *sp) ...@@ -261,16 +261,15 @@ vbe_Healthy(const struct vdi_simple *vs, const struct sess *sp)
/* VRT/VCC sets threshold to UINT_MAX to mark that it's not /* VRT/VCC sets threshold to UINT_MAX to mark that it's not
* specified by VCL (thus use param). * specified by VCL (thus use param).
*/ */
if (vs->vrt->saintmode_threshold == UINT_MAX) threshold = vs->vrt->saintmode_threshold;
if (threshold == UINT_MAX)
threshold = cache_param->saintmode_threshold; threshold = cache_param->saintmode_threshold;
else
threshold = vs->vrt->saintmode_threshold;
if (backend->admin_health == ah_healthy) if (backend->admin_health == ah_healthy)
threshold = UINT_MAX; threshold = UINT_MAX;
/* Saintmode is disabled */ /* Saintmode is disabled, or list is empty */
if (threshold == 0) if (threshold == 0 || VTAILQ_EMPTY(&backend->troublelist))
return (1); return (1);
if (sp->req->objcore == NULL) if (sp->req->objcore == NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment