The sync path previously scheduled itself out unconditionally, but
that shouldn't happen if the command wasn't posted to the submission
queue. This patch returns immediately when the suspended queue returns
busy status.
Orabug:
21316131
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
struct sync_cmd_info cmdinfo;
struct nvme_cmd_info *cmd_rq = blk_mq_rq_to_pdu(req);
struct nvme_queue *nvmeq = cmd_rq->nvmeq;
+ int ret;
cmdinfo.task = current;
cmdinfo.status = -EINTR;
nvme_set_info(cmd_rq, &cmdinfo, sync_completion);
set_current_state(TASK_UNINTERRUPTIBLE);
- nvme_submit_cmd(nvmeq, cmd);
+ ret = nvme_submit_cmd(nvmeq, cmd);
+ if (ret)
+ return ret;
+
schedule();
if (result)