From: maxg@mellanox.com (Max Gurtovoy)
Subject: [PATCH] nvme: Fix error flow at nvme_rdma_configure_admin_queue()
Date: Tue, 19 Jun 2018 15:09:16 +0300 [thread overview]
Message-ID: <a75ce20c-e217-e2f8-6015-b6e2987499db@mellanox.com> (raw)
In-Reply-To: <b26fe840-8521-82f6-39c4-e5976e37c4a8@grimberg.me>
On 6/19/2018 1:36 PM, Sagi Grimberg wrote:
>
>>>> back instead and have a different double free protection.? E.g.
>>>> in nvme_rdma_free_qe just check if qe->data is set first,
>>>> and the NULL it out when freeing.
>>>>
>>>
>>> I guess we can but this is not enough since we'll need to move the
>>> call to
>>> nvme_rdma_free_qe to be after stopping the queue. I actually think that
>>> making it symetrical is the right way to go (we also have a flag
>>> NVME_RDMA_Q_ALLOCATED that helps here) but I guess reverting Sagi's
>>> commit
>>> + some fix will work too.
>
> I don't think this is the way to go. And I don't think that reverting it
> is either the way to go.
>
> The commit message said:
> --
> ??? nvme-rdma: Fix possible double free in reconnect flow
>
> ??? The fact that we free the async event buffer in
> ??? nvme_rdma_destroy_admin_queue can cause us to free it
> ??? more than once because this happens in every reconnect
> ??? attempt since commit 31fdf1840170. we rely on the queue
> ??? state flags DELETING to avoid this for other resources.
>
> ??? A more complete fix is to not destroy the admin/io queues
> ??? unconditionally on every reconnect attempt, but its a bit
> ??? more extensive and will go in the next release.
> --
>
> Today, we don't destroy the admin queue on every reconnect so
> I think we are OK with restoring it back, but looking at the code
> some more is needed.
>
> I think that the async buffer needs to be allocated right after
> nvme_alloc_rdma_queue and to be free right before nvme_rdma_free_queue.
why ? we call nvme_start_ctrl after configuring the admin queue. and we
free the async buffer after we drain the QP.
am I missing something ?
next prev parent reply other threads:[~2018-06-19 12:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-14 12:37 [PATCH] nvme: Fix error flow at nvme_rdma_configure_admin_queue() Israel Rukshin
2018-06-15 8:01 ` Christoph Hellwig
2018-06-17 10:52 ` Max Gurtovoy
2018-06-19 5:41 ` Christoph Hellwig
2018-06-19 10:36 ` Sagi Grimberg
2018-06-19 12:09 ` Max Gurtovoy [this message]
2018-06-19 12:30 ` Sagi Grimberg
2018-06-19 16:08 ` Max Gurtovoy
2018-06-19 16:12 ` Sagi Grimberg
2018-06-19 16:21 ` Max Gurtovoy
2018-06-19 16:38 ` Sagi Grimberg
2018-06-19 11:57 ` Max Gurtovoy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a75ce20c-e217-e2f8-6015-b6e2987499db@mellanox.com \
--to=maxg@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox