Skip to content

Commit

Permalink
NVMe: Schedule timeout for sync commands
Browse files Browse the repository at this point in the history
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 <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
  • Loading branch information
Keith Busch authored and Matthew Wilcox committed May 2, 2013
1 parent f410c68 commit 78f8d25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/nvme-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 78f8d25

Please sign in to comment.