Commit afed0f61 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Let req_fsm deref its own bo->ref on failure

parent 2eb5e555
...@@ -753,7 +753,6 @@ cnt_fetch(struct worker *wrk, struct req *req, struct busyobj *bo) ...@@ -753,7 +753,6 @@ cnt_fetch(struct worker *wrk, struct req *req, struct busyobj *bo)
assert(bo->refcount == 2); assert(bo->refcount == 2);
bo->storage_hint = NULL; bo->storage_hint = NULL;
VBO_DerefBusyObj(wrk, &bo); VBO_DerefBusyObj(wrk, &bo);
VBO_DerefBusyObj(wrk, &req->busyobj);
req->director = NULL; req->director = NULL;
switch (wrk->handling) { switch (wrk->handling) {
...@@ -881,7 +880,6 @@ VBF_Fetch(struct worker *wrk, struct req *req) ...@@ -881,7 +880,6 @@ VBF_Fetch(struct worker *wrk, struct req *req)
AZ(HSH_Deref(&wrk->stats, req->objcore, NULL)); AZ(HSH_Deref(&wrk->stats, req->objcore, NULL));
req->objcore = NULL; req->objcore = NULL;
VDI_CloseFd(&bo->vbc); VDI_CloseFd(&bo->vbc);
VBO_DerefBusyObj(wrk, &req->busyobj);
return (-1); return (-1);
} else } else
/* No vary */ /* No vary */
...@@ -919,7 +917,6 @@ VBF_Fetch(struct worker *wrk, struct req *req) ...@@ -919,7 +917,6 @@ VBF_Fetch(struct worker *wrk, struct req *req)
AZ(HSH_Deref(&wrk->stats, req->objcore, NULL)); AZ(HSH_Deref(&wrk->stats, req->objcore, NULL));
req->objcore = NULL; req->objcore = NULL;
VDI_CloseFd(&bo->vbc); VDI_CloseFd(&bo->vbc);
VBO_DerefBusyObj(wrk, &req->busyobj);
return (-1); return (-1);
} }
CHECK_OBJ_NOTNULL(req->obj, OBJECT_MAGIC); CHECK_OBJ_NOTNULL(req->obj, OBJECT_MAGIC);
...@@ -996,7 +993,6 @@ VBF_Fetch(struct worker *wrk, struct req *req) ...@@ -996,7 +993,6 @@ VBF_Fetch(struct worker *wrk, struct req *req)
} else if (bo->state == BOS_FAILED) { } else if (bo->state == BOS_FAILED) {
/* handle early failures */ /* handle early failures */
(void)HSH_Deref(&wrk->stats, NULL, &req->obj); (void)HSH_Deref(&wrk->stats, NULL, &req->obj);
VBO_DerefBusyObj(wrk, &req->busyobj);
return (-1); return (-1);
} }
......
...@@ -356,14 +356,17 @@ cnt_fetch(struct worker *wrk, struct req *req) ...@@ -356,14 +356,17 @@ cnt_fetch(struct worker *wrk, struct req *req)
CHECK_OBJ_NOTNULL(req, REQ_MAGIC); CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
i = VBF_Fetch(wrk, req); i = VBF_Fetch(wrk, req);
if (i < 0) { if (i == 0) {
assert(WRW_IsReleased(wrk));
req->req_step = R_STP_PREPRESP;
} else if (i < 0) {
VBO_DerefBusyObj(wrk, &req->busyobj);
req->err_code = 503; req->err_code = 503;
req->req_step = R_STP_ERROR; req->req_step = R_STP_ERROR;
} else if (i == 1) {
req->req_step = R_STP_RESTART;
} else { } else {
assert(WRW_IsReleased(wrk)); VBO_DerefBusyObj(wrk, &req->busyobj);
req->req_step = R_STP_PREPRESP; assert(i == 1);
req->req_step = R_STP_RESTART;
} }
return (REQ_FSM_MORE); return (REQ_FSM_MORE);
} }
......
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