Skip to content

Commit

Permalink
be paranoid when marking workspace overflows
Browse files Browse the repository at this point in the history
issue a membar to ensure that the overflow marker is written
before a failing WS allocation returns and is thus visible from
a different context.

pan_ic() already has an implicit membar via the mutex lock.

Ref varnishcache#2645
  • Loading branch information
nigoroll committed Apr 19, 2018
1 parent 4687245 commit f5ce551
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/varnishd/cache/cache_ws.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "config.h"

#include "cache_varnishd.h"
#include "vmb.h"

#include <stdio.h>

Expand Down Expand Up @@ -115,6 +116,7 @@ WS_MarkOverflow(struct ws *ws)
CHECK_OBJ_NOTNULL(ws, WS_MAGIC);

ws->id[0] &= ~0x20; // cheesy toupper()
VWMB();
}

static void
Expand Down

0 comments on commit f5ce551

Please sign in to comment.