From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH 1/1] nvme-rdma: Add association between ctrl and transport dev
Date: Thu, 23 May 2019 12:22:36 +0200 [thread overview]
Message-ID: <20190523102236.GC15492@lst.de> (raw)
In-Reply-To: <1558444796-5190-1-git-send-email-maxg@mellanox.com>
> +static void nvme_rdma_ctrl_dev_put(struct nvme_rdma_ctrl *ctrl,
> + struct nvme_rdma_device *dev)
> +{
> + ctrl->device = NULL;
double whitespace here.
> + kref_put(&dev->ref, nvme_rdma_free_dev);
> +}
> +
> +static void nvme_rdma_ctrl_dev_get(struct nvme_rdma_ctrl *ctrl,
> + struct nvme_rdma_device *dev)
> +{
> + kref_get(&dev->ref);
> + ctrl->device = dev;
Why aren't these using nvme_rdma_dev_put / nvme_rdma_dev_get?
> static void nvme_rdma_destroy_admin_queue(struct nvme_rdma_ctrl *ctrl,
> bool remove)
> {
> + struct nvme_rdma_device *ndev = ctrl->device;
> +
> if (remove) {
> blk_cleanup_queue(ctrl->ctrl.admin_q);
> blk_mq_free_tag_set(ctrl->ctrl.admin_tagset);
> + /* ctrl releases refcount on device */
> + nvme_rdma_ctrl_dev_put(ctrl, ctrl->device);
> }
> if (ctrl->async_event_sqe.data) {
> - nvme_rdma_free_qe(ctrl->device->dev, &ctrl->async_event_sqe,
> + nvme_rdma_free_qe(ndev->dev, &ctrl->async_event_sqe,
What guarantees ndev is not freed here?
next prev parent reply other threads:[~2019-05-23 10:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-21 13:19 [PATCH 1/1] nvme-rdma: Add association between ctrl and transport dev Max Gurtovoy
2019-05-23 8:13 ` [Suspected-Phishing][PATCH " Max Gurtovoy
2019-05-23 10:22 ` Christoph Hellwig [this message]
2019-05-23 11:05 ` [PATCH " Max Gurtovoy
2019-05-23 15:33 ` Christoph Hellwig
2019-05-24 19:36 ` Max Gurtovoy
2019-05-24 7:05 ` Sagi Grimberg
2019-05-24 19:30 ` Max Gurtovoy
2019-05-24 23:05 ` Sagi Grimberg
2019-05-28 11:50 ` Max Gurtovoy
2019-05-28 19:36 ` Sagi Grimberg
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=20190523102236.GC15492@lst.de \
--to=hch@lst.de \
/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