Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
acba53a8
Commit
acba53a8
authored
Nov 19, 2015
by
Poul-Henning Kamp
Committed by
Lasse Karstensen
Jan 13, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Be more rigid about locking in cache_ban.
parent
3c8b8e1d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
cache_ban.c
bin/varnishd/cache/cache_ban.c
+16
-12
No files found.
bin/varnishd/cache/cache_ban.c
View file @
acba53a8
...
@@ -237,14 +237,14 @@ BAN_DestroyObj(struct objcore *oc)
...
@@ -237,14 +237,14 @@ BAN_DestroyObj(struct objcore *oc)
{
{
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
if
(
oc
->
ban
==
NULL
)
return
;
CHECK_OBJ_NOTNULL
(
oc
->
ban
,
BAN_MAGIC
);
Lck_Lock
(
&
ban_mtx
);
Lck_Lock
(
&
ban_mtx
);
CHECK_OBJ_ORNULL
(
oc
->
ban
,
BAN_MAGIC
);
if
(
oc
->
ban
!=
NULL
)
{
assert
(
oc
->
ban
->
refcount
>
0
);
assert
(
oc
->
ban
->
refcount
>
0
);
oc
->
ban
->
refcount
--
;
oc
->
ban
->
refcount
--
;
VTAILQ_REMOVE
(
&
oc
->
ban
->
objcore
,
oc
,
ban_list
);
VTAILQ_REMOVE
(
&
oc
->
ban
->
objcore
,
oc
,
ban_list
);
oc
->
ban
=
NULL
;
oc
->
ban
=
NULL
;
}
Lck_Unlock
(
&
ban_mtx
);
Lck_Unlock
(
&
ban_mtx
);
}
}
...
@@ -549,22 +549,26 @@ BAN_CheckObject(struct worker *wrk, struct objcore *oc, struct req *req)
...
@@ -549,22 +549,26 @@ BAN_CheckObject(struct worker *wrk, struct objcore *oc, struct req *req)
oc
->
ban
->
refcount
--
;
oc
->
ban
->
refcount
--
;
VTAILQ_REMOVE
(
&
oc
->
ban
->
objcore
,
oc
,
ban_list
);
VTAILQ_REMOVE
(
&
oc
->
ban
->
objcore
,
oc
,
ban_list
);
if
(
b
==
oc
->
ban
)
{
/* not banned */
if
(
b
==
oc
->
ban
)
{
/* not banned */
VTAILQ_INSERT_TAIL
(
&
b0
->
objcore
,
oc
,
ban_list
);
VTAILQ_INSERT_TAIL
(
&
b0
->
objcore
,
oc
,
ban_list
);
b0
->
refcount
++
;
b0
->
refcount
++
;
oc
->
ban
=
b0
;
b
=
NULL
;
}
else
{
oc
->
ban
=
NULL
;
}
}
if
(
oc
->
ban
->
refcount
==
0
&&
VTAILQ_NEXT
(
oc
->
ban
,
list
)
==
NULL
)
if
(
VTAILQ_LAST
(
&
ban_head
,
banhead_s
)
->
refcount
==
0
)
ban_kick_lurker
();
ban_kick_lurker
();
Lck_Unlock
(
&
ban_mtx
);
Lck_Unlock
(
&
ban_mtx
);
if
(
b
==
oc
->
ban
)
{
/* not banned */
if
(
b
==
NULL
)
{
oc
->
ban
=
b0
;
/* not banned */
ObjUpdateMeta
(
wrk
,
oc
);
ObjUpdateMeta
(
wrk
,
oc
);
return
(
0
);
return
(
0
);
}
else
{
}
else
{
oc
->
ban
=
NULL
;
VSLb
(
vsl
,
SLT_ExpBan
,
"%u banned lookup"
,
ObjGetXID
(
wrk
,
oc
));
VSLb
(
vsl
,
SLT_ExpBan
,
"%u banned lookup"
,
ObjGetXID
(
wrk
,
oc
));
VSC_C_main
->
bans_obj_killed
++
;
VSC_C_main
->
bans_obj_killed
++
;
EXP_Rearm
(
oc
,
oc
->
exp
.
t_origin
,
0
,
0
,
0
);
// XXX fake now
EXP_Rearm
(
oc
,
oc
->
exp
.
t_origin
,
0
,
0
,
0
);
// XXX fake now
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment