nvme-rdma: fix timeout handler
authorSagi Grimberg <sagi@grimberg.me>
Tue, 8 Jan 2019 08:53:22 +0000 (00:53 -0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 24 Jan 2019 00:16:59 +0000 (17:16 -0700)
commit4c174e6366746ae8d49f9cc409f728eebb7a9ac9
treeec4a787d4180da6a704960e6d9ca6cb2b4d05435
parent7fc5854f8c6efae9e7624970ab49a1eac2faefb1
nvme-rdma: fix timeout handler

Currently, we have several problems with the timeout
handler:
1. If we timeout on the controller establishment flow, we will hang
because we don't execute the error recovery (and we shouldn't because
the create_ctrl flow needs to fail and cleanup on its own)
2. We might also hang if we get a disconnet on a queue while the
controller is already deleting. This racy flow can cause the controller
disable/shutdown admin command to hang.

We cannot complete a timed out request from the timeout handler without
mutual exclusion from the teardown flow (e.g. nvme_rdma_error_recovery_work).
So we serialize it in the timeout handler and teardown io and admin
queues to guarantee that no one races with us from completing the
request.

Reported-by: Jaesoo Lee <jalee@purestorage.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/rdma.c