[PATCH v2 6/8] nvme-rdma: serialize controller teardown sequences

Christoph Hellwig hch at lst.de
Fri Aug 14 02:45:47 EDT 2020


On Thu, Aug 06, 2020 at 12:11:25PM -0700, Sagi Grimberg wrote:
> In the timeout handler we may need to complete a request because the
> request that timed out may be an I/O that is a part of a serial sequence
> of controller teardown or initialization. In order to complete the
> request, we need to fence any other context that may compete with us
> and complete the request that is timing out.
> 
> In this case, we could have a potential double completion in case
> a hard-irq or a different competing context triggered error recovery
> and is running inflight request cancellation concurrently with the
> timeout handler.
> 
> Protect using a ctrl teardown_lock to serialize contexts that may
> complete a cancelled request due to error recovery or a reset.
> 
> Signed-off-by: Sagi Grimberg <sagi at grimberg.me>

Looks sensible:

Reviewed-by: Christoph Hellwig <hch at lst.de>



More information about the Linux-nvme mailing list