[PATCH 1/2] nvme-core: use I/O timeout for I/O requests

Keith Busch kbusch at kernel.org
Wed Sep 2 12:48:52 EDT 2020


On Tue, Sep 01, 2020 at 07:13:07PM -0700, Chaitanya Kulkarni wrote:
> @@ -885,7 +885,9 @@ int __nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
>  	if (IS_ERR(req))
>  		return PTR_ERR(req);
>  
> -	req->timeout = timeout ? timeout : ADMIN_TIMEOUT;
> +	req->timeout = timeout;
> +	if (!req->timeout)
> +		req->timeout = qid > 0 ? NVME_IO_TIMEOUT : ADMIN_TIMEOUT;

The 'qid' value doesn't quite mean what you want it to here. In this
function, qid is usually set to -1, NVME_QID_ANY, for all requests.

At least for now, the admin request_queue's q->queuedata is NULL, and IO
request_queue queuedata are not. I think that's the only indication you
have in this context for whether the command is IO vs Admin.



More information about the Linux-nvme mailing list