Move setting of CAM_SIM_QUEUED to before we actually submit it to the
hardware. Setting it after is racy, and we can lose the race on a heavily loaded system. Reviewed by: scottl@, gallatin@ Sponsored by: Netflix
This commit is contained in:
parent
0b968fec5b
commit
5af8ebb2f8
@ -76,6 +76,7 @@ nvme_sim_nvmeio_done(void *ccb_arg, const struct nvme_completion *cpl)
|
||||
* it means. Make our best guess, though for the status code.
|
||||
*/
|
||||
memcpy(&ccb->nvmeio.cpl, cpl, sizeof(*cpl));
|
||||
ccb->ccb_h.status &= ~CAM_SIM_QUEUED;
|
||||
if (nvme_completion_is_error(cpl)) {
|
||||
ccb->ccb_h.status = CAM_REQ_CMP_ERR;
|
||||
xpt_done(ccb);
|
||||
@ -114,6 +115,7 @@ nvme_sim_nvmeio(struct cam_sim *sim, union ccb *ccb)
|
||||
xpt_done(ccb);
|
||||
return;
|
||||
}
|
||||
ccb->ccb_h.status |= CAM_SIM_QUEUED;
|
||||
|
||||
memcpy(&req->cmd, &ccb->nvmeio.cmd, sizeof(ccb->nvmeio.cmd));
|
||||
|
||||
@ -121,8 +123,6 @@ nvme_sim_nvmeio(struct cam_sim *sim, union ccb *ccb)
|
||||
nvme_ctrlr_submit_io_request(ctrlr, req);
|
||||
else
|
||||
nvme_ctrlr_submit_admin_request(ctrlr, req);
|
||||
|
||||
ccb->ccb_h.status |= CAM_SIM_QUEUED;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
|
Loading…
Reference in New Issue
Block a user