From: Keith Busch Date: Tue, 30 Apr 2013 17:19:38 +0000 (-0600) Subject: NVMe: Do not cancel command multiple times X-Git-Tag: upstream/snapshot3+hdmi~4943^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=053ab702cc2702f25a97ead087ed344b864785b7;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git NVMe: Do not cancel command multiple times Cancelling an already cancelled command does not do anything, so check the command context before cancelling it, continuing if had already been cancelled so we do not log the same problem every second if a device stops 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 d783f15..42abf72 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c @@ -978,6 +978,8 @@ static void nvme_cancel_ios(struct nvme_queue *nvmeq, bool timeout) if (timeout && !time_after(now, info[cmdid].timeout)) continue; + if (info[cmdid].ctx == CMD_CTX_CANCELLED) + continue; dev_warn(nvmeq->q_dmadev, "Cancelling I/O %d\n", cmdid); ctx = cancel_cmdid(nvmeq, cmdid, &fn); fn(nvmeq->dev, ctx, &cqe);