Commit e3deca91 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Tollef Fog Heen

Enforce that oc_getobj() does not work on BUSY objcores.

parent 03fe1a49
...@@ -434,6 +434,7 @@ oc_getobj(struct worker *wrk, struct objcore *oc) ...@@ -434,6 +434,7 @@ oc_getobj(struct worker *wrk, struct objcore *oc)
{ {
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
AZ(oc->flags & OC_F_BUSY);
AN(oc->methods); AN(oc->methods);
AN(oc->methods->getobj); AN(oc->methods->getobj);
return (oc->methods->getobj(wrk, oc)); return (oc->methods->getobj(wrk, oc));
......
...@@ -594,7 +594,6 @@ HSH_Unbusy(const struct sess *sp) ...@@ -594,7 +594,6 @@ HSH_Unbusy(const struct sess *sp)
AssertObjBusy(o); AssertObjBusy(o);
AN(oc->ban); AN(oc->ban);
assert(oc_getobj(sp->wrk, oc) == o);
assert(oc->refcnt > 0); assert(oc->refcnt > 0);
assert(oh->refcnt > 0); assert(oh->refcnt > 0);
if (o->ws_o->overflow) if (o->ws_o->overflow)
...@@ -613,6 +612,7 @@ HSH_Unbusy(const struct sess *sp) ...@@ -613,6 +612,7 @@ HSH_Unbusy(const struct sess *sp)
hsh_rush(oh); hsh_rush(oh);
AN(oc->ban); AN(oc->ban);
Lck_Unlock(&oh->mtx); Lck_Unlock(&oh->mtx);
assert(oc_getobj(sp->wrk, oc) == o);
} }
void void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment