[4.1] 3f6de09 Volatile read of the VCL temperature
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Mon Sep 12 17:57:13 CEST 2016
commit 3f6de092898e40346f2f0b1c612e8ed8b9719caa
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date: Tue Aug 30 21:37:34 2016 +0200
Volatile read of the VCL temperature
There is currently no locking around temperature changes despite the
fact that it may be read outside of the CLI thread to make decisions.
In the case of a panic, instead of locking we simply make sure not to
perform an incomplete read of the pointer.
diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c
index 3a38bc4..234238b 100644
--- a/bin/varnishd/cache/cache_vcl.c
+++ b/bin/varnishd/cache/cache_vcl.c
@@ -106,7 +106,7 @@ VCL_Panic(struct vsb *vsb, const struct vcl *vcl)
VSB_printf(vsb, "busy = %u\n", vcl->busy);
VSB_printf(vsb, "discard = %u,\n", vcl->discard);
VSB_printf(vsb, "state = %s,\n", vcl->state);
- VSB_printf(vsb, "temp = %s,\n", vcl->temp);
+ VSB_printf(vsb, "temp = %s,\n", (const volatile char *)vcl->temp);
VSB_printf(vsb, "conf = {\n");
VSB_indent(vsb, 2);
if (vcl->conf == NULL) {
More information about the varnish-commit
mailing list