[master] 9075b40 Revert to wrlock to avoid vd->vbm trampling

Guillaume Quintard guillaume at varnish-software.com
Thu Aug 11 11:34:08 CEST 2016


commit 9075b405cde6b59f71563fa2a9229bdefc4a7f4d
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 edee43c..ddcd1f7 100644
--- a/lib/libvmod_directors/vdir.c
+++ b/lib/libvmod_directors/vdir.c
@@ -213,7 +213,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