[4.1] c3374b1 Revert to wrlock to avoid vd->vbm trampling

PÃ¥l Hermunn Johansen hermunn at varnish-software.com
Tue Sep 6 10:35:14 CEST 2016


commit c3374b185e7db43db673590fdefc4424ca8de610
Author: Guillaume Quintard <guillaume at varnish-software.com>
Date:   Tue Aug 2 11:34:21 2016 +0200

    Revert to wrlock to avoid vd->vbm trampling
    
    fix #2027

diff --git a/lib/libvmod_directors/vdir.c b/lib/libvmod_directors/vdir.c
index e5a52a3..cdaa09b 100644
--- a/lib/libvmod_directors/vdir.c
+++ b/lib/libvmod_directors/vdir.c
@@ -217,7 +217,7 @@ vdir_pick_be(struct vdir *vd, double w, const struct busyobj *bo)
 	double tw = 0.0;
 	VCL_BACKEND be = NULL;
 
-	vdir_rdlock(vd);
+	vdir_wrlock(vd);
 	for (u = 0; u < vd->n_backend; u++) {
 		if (vd->backend[u]->healthy(vd->backend[u], bo, NULL)) {
 			vbit_clr(vd->vbm, u);



More information about the varnish-commit mailing list