[PATCH 6/6] nvme: return -ETIMEDOUT in nvme_submit_sync_cmd()

Hannes Reinecke hare at suse.de
Thu Feb 25 12:28:59 EST 2021


On 2/25/21 5:31 PM, Keith Busch wrote:
> On Thu, Feb 25, 2021 at 11:55:27AM +0100, Hannes Reinecke wrote:
>> When a command times out we should be returning -ETIMEDOUT in
>> nvme_submit_sync_cmd(), and not requiring the caller to guess whether
>> a specific NVMe status should be interpreted as a timeout.
> 
> This driver has been using -EINTR for this condition since the
> beginning, though. Is there a reason I'm not seeing why these use cases
> can't use the existing command cancelled flag?
>   
Technically we have two distinct conditions, a command being aborted due 
to a timeout, and a command being aborted due to a queue disconnect.
Admittedly, the second conditions is the common case, as the queue 
disconnect is typically done due to the error recovery kicking in, which 
in itself is in reaction to a KATO timeout firing.
The first condition is only hit if we run into a timeout for the initial 
commands _before_ KATO is started.

And I thought it might be good to have these two cases differentiated.
But I'd be fine with dropping it if that's not needed.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare at suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer



More information about the Linux-nvme mailing list