[master] 05810d097 Spray vsmw_assert_lock()
Nils Goroll
nils.goroll at uplex.de
Thu Jun 29 06:57:08 UTC 2023
commit 05810d09714cdd3fb1e0cdc572189f0a95931a51
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Wed Jun 28 17:52:52 2023 +0200
Spray vsmw_assert_lock()
Motivated by #3948
diff --git a/bin/varnishd/common/common_vsmw.c b/bin/varnishd/common/common_vsmw.c
index 85afe07c7..758ac82fa 100644
--- a/bin/varnishd/common/common_vsmw.c
+++ b/bin/varnishd/common/common_vsmw.c
@@ -155,6 +155,7 @@ static void
vsmw_fmt_index(const struct vsmw *vsmw, const struct vsmwseg *seg, char act)
{
+ vsmw_assert_lock();
CHECK_OBJ_NOTNULL(vsmw, VSMW_MAGIC);
CHECK_OBJ_NOTNULL(seg, VSMWSEG_MAGIC);
AN(seg->cluster);
@@ -198,6 +199,7 @@ vsmw_append_record(struct vsmw *vsmw, struct vsmwseg *seg, char act)
{
int fd;
+ vsmw_assert_lock();
CHECK_OBJ_NOTNULL(vsmw, VSMW_MAGIC);
CHECK_OBJ_NOTNULL(seg, VSMWSEG_MAGIC);
fd = openat(vsmw->vdirfd, vsmw->idx, O_APPEND | O_WRONLY);
@@ -271,6 +273,7 @@ vsmw_newcluster(struct vsmw *vsmw, size_t len, const char *pfx)
int fd;
size_t ps;
+ vsmw_assert_lock();
ALLOC_OBJ(vc, VSMW_CLUSTER_MAGIC);
AN(vc);
@@ -331,6 +334,7 @@ static void
vsmw_DestroyCluster_locked(struct vsmw *vsmw, struct vsmw_cluster *vc)
{
+ vsmw_assert_lock();
CHECK_OBJ_NOTNULL(vsmw, VSMW_MAGIC);
CHECK_OBJ_NOTNULL(vc, VSMW_CLUSTER_MAGIC);
More information about the varnish-commit
mailing list