[PATCH] NVMe: Use error handling on failed sync commands

Matthew Wilcox willy at linux.intel.com
Fri Dec 20 13:47:10 EST 2013


On Fri, Dec 20, 2013 at 11:14:09AM -0700, Keith Busch wrote:
> Sync commands schedule an internal timeout to cancel rather than using
> the nvme timeout handler kthread. We should still try to recover so
> moving the check for cancelled commands after the error handling.

>  		if (timeout && !time_after(now, info[cmdid].timeout))
>  			continue;
> -		if (info[cmdid].ctx == CMD_CTX_CANCELLED)
> -			continue;
>  		if (timeout && nvmeq->dev->initialized) {
>  			nvme_abort_cmd(cmdid, nvmeq);
>  			continue;
>  		}
> +		if (info[cmdid].ctx == CMD_CTX_CANCELLED)
> +			continue;
>  		dev_warn(nvmeq->q_dmadev, "Cancelling I/O %d QID %d\n", cmdid,
>  								nvmeq->qid);
>  		ctx = cancel_cmdid(nvmeq, cmdid, &fn);

I'm confused by this patch.  Won't it cause us to send abort commands
repeatedly for commands IDs that have already been cancelled, but haven't
yet been completed as cancelled?



More information about the Linux-nvme mailing list