]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
NVMe: Return busy status on suspended queue
authorKeith Busch <keith.busch@intel.com>
Thu, 25 Jun 2015 15:32:38 +0000 (08:32 -0700)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Mon, 29 Jun 2015 22:33:10 +0000 (15:33 -0700)
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>
drivers/block/nvme-core.c

index 683dff272562b16d325df65495ad6a868cf45b14..a08ee2d69b14e9b588a478100df2c80ec0217d7f 100644 (file)
@@ -997,6 +997,7 @@ static int nvme_submit_sync_cmd(struct request *req, struct nvme_command *cmd,
        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;
@@ -1006,7 +1007,10 @@ static int nvme_submit_sync_cmd(struct request *req, struct nvme_command *cmd,
        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)