From: Keith Busch Date: Fri, 19 Apr 2013 20:11:06 +0000 (-0600) Subject: NVMe: Schedule timeout for sync commands X-Git-Tag: v3.14.22-mvebu~3354^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=78f8d2577bd79ce9d62f4d9e6d3b895bd1dd1d1d;p=people%2Farne_f%2Fkernel.git NVMe: Schedule timeout for sync commands Schedule a timeout on sync commands in case the command times out and the device is not being polled for timeouts. This prevents device removal from hanging forever if the device has stopped responding. Signed-off-by: Keith Busch Signed-off-by: Matthew Wilcox --- diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index 5a3f2235892af..a232dfc1cd4a5 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c @@ -828,7 +828,7 @@ int nvme_submit_sync_cmd(struct nvme_queue *nvmeq, struct nvme_command *cmd, set_current_state(TASK_KILLABLE); nvme_submit_cmd(nvmeq, cmd); - schedule(); + schedule_timeout(timeout); if (cmdinfo.status == -EINTR) { nvme_abort_command(nvmeq, cmdid);