* [PATCH 1/1] nvme-rdma: fix error flow during controller reset
@ 2018-06-17 14:57 Max Gurtovoy
2018-06-19 5:15 ` Christoph Hellwig
0 siblings, 1 reply; 4+ messages in thread
From: Max Gurtovoy @ 2018-06-17 14:57 UTC (permalink / raw)
In case the IO queues configuration fails, we never destroy the admin
queue.
Signed-off-by: Max Gurtovoy <maxg at mellanox.com>
---
drivers/nvme/host/rdma.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index cef24ad..c193f61 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -1781,7 +1781,7 @@ static void nvme_rdma_reset_ctrl_work(struct work_struct *work)
if (ctrl->ctrl.queue_count > 1) {
ret = nvme_rdma_configure_io_queues(ctrl, false);
if (ret)
- goto out_fail;
+ goto destroy_admin;
}
changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE);
@@ -1795,6 +1795,8 @@ static void nvme_rdma_reset_ctrl_work(struct work_struct *work)
return;
+destroy_admin:
+ nvme_rdma_destroy_admin_queue(ctrl, false);
out_fail:
++ctrl->ctrl.nr_reconnects;
nvme_rdma_reconnect_or_remove(ctrl);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 1/1] nvme-rdma: fix error flow during controller reset
2018-06-17 14:57 [PATCH 1/1] nvme-rdma: fix error flow during controller reset Max Gurtovoy
@ 2018-06-19 5:15 ` Christoph Hellwig
2018-06-19 9:49 ` Max Gurtovoy
2018-06-19 16:40 ` Sagi Grimberg
0 siblings, 2 replies; 4+ messages in thread
From: Christoph Hellwig @ 2018-06-19 5:15 UTC (permalink / raw)
> ret = nvme_rdma_configure_io_queues(ctrl, false);
> if (ret)
> - goto out_fail;
> + goto destroy_admin;
> }
>
> changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE);
> @@ -1795,6 +1795,8 @@ static void nvme_rdma_reset_ctrl_work(struct work_struct *work)
>
> return;
>
> +destroy_admin:
> + nvme_rdma_destroy_admin_queue(ctrl, false);
> out_fail:
> ++ctrl->ctrl.nr_reconnects;
> nvme_rdma_reconnect_or_remove(ctrl);
What about:
nvme_rdma_reconnect_or_remove
-> nvme_delete_ctrl
-> nvme_rdma_delete_ctrl
-> nvme_rdma_shutdown_ctrl
-> nvme_rdma_destroy_admin_queue
?
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 1/1] nvme-rdma: fix error flow during controller reset
2018-06-19 5:15 ` Christoph Hellwig
@ 2018-06-19 9:49 ` Max Gurtovoy
2018-06-19 16:40 ` Sagi Grimberg
1 sibling, 0 replies; 4+ messages in thread
From: Max Gurtovoy @ 2018-06-19 9:49 UTC (permalink / raw)
On 6/19/2018 8:15 AM, Christoph Hellwig wrote:
>> ret = nvme_rdma_configure_io_queues(ctrl, false);
>> if (ret)
>> - goto out_fail;
>> + goto destroy_admin;
>> }
>>
>> changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE);
>> @@ -1795,6 +1795,8 @@ static void nvme_rdma_reset_ctrl_work(struct work_struct *work)
>>
>> return;
>>
>> +destroy_admin:
>> + nvme_rdma_destroy_admin_queue(ctrl, false);
>> out_fail:
>> ++ctrl->ctrl.nr_reconnects;
>> nvme_rdma_reconnect_or_remove(ctrl);
>
> What about:
>
> nvme_rdma_reconnect_or_remove
> -> nvme_delete_ctrl
> -> nvme_rdma_delete_ctrl
> -> nvme_rdma_shutdown_ctrl
> -> nvme_rdma_destroy_admin_queue
>
> ?
>
if you worry about calling nvme_rdma_destroy_admin_queue twice so it's
fine since we check test_and_clear_bit in nvme_rdma_stop_queue and
nvme_rdma_free_queue
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] nvme-rdma: fix error flow during controller reset
2018-06-19 5:15 ` Christoph Hellwig
2018-06-19 9:49 ` Max Gurtovoy
@ 2018-06-19 16:40 ` Sagi Grimberg
1 sibling, 0 replies; 4+ messages in thread
From: Sagi Grimberg @ 2018-06-19 16:40 UTC (permalink / raw)
>> ret = nvme_rdma_configure_io_queues(ctrl, false);
>> if (ret)
>> - goto out_fail;
>> + goto destroy_admin;
>> }
>>
>> changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE);
>> @@ -1795,6 +1795,8 @@ static void nvme_rdma_reset_ctrl_work(struct work_struct *work)
>>
>> return;
>>
>> +destroy_admin:
>> + nvme_rdma_destroy_admin_queue(ctrl, false);
>> out_fail:
>> ++ctrl->ctrl.nr_reconnects;
>> nvme_rdma_reconnect_or_remove(ctrl);
>
> What about:
>
> nvme_rdma_reconnect_or_remove
> -> nvme_delete_ctrl
> -> nvme_rdma_delete_ctrl
> -> nvme_rdma_shutdown_ctrl
> -> nvme_rdma_destroy_admin_queue
>
> ?
I think this is a result of code duplicated in different flows which
drifted although the logic should remain the same...
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-06-19 16:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-17 14:57 [PATCH 1/1] nvme-rdma: fix error flow during controller reset Max Gurtovoy
2018-06-19 5:15 ` Christoph Hellwig
2018-06-19 9:49 ` Max Gurtovoy
2018-06-19 16:40 ` Sagi Grimberg
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.