linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: David Milburn <dmilburn@redhat.com>
To: linux-nvme@lists.infradead.org, sagi@grimberg.me, hch@lst.de,
	james.smart@broadcom.com
Subject: [PATCH v3 2/3] nvme-tcp: cancel async events before freeing event struct
Date: Wed,  2 Sep 2020 17:42:53 -0500	[thread overview]
Message-ID: <1599086574-85969-3-git-send-email-dmilburn@redhat.com> (raw)
In-Reply-To: <1599086574-85969-1-git-send-email-dmilburn@redhat.com>

Cancel async event work in case async event has been queued
up, and nvme_tcp_submit_async_event() runs after event has
been freed.

Signed-off-by: David Milburn <dmilburn@redhat.com>
---
 drivers/nvme/host/tcp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 16851ae3bddf..8f4f29f18b8c 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -1596,6 +1596,7 @@ static struct blk_mq_tag_set *nvme_tcp_alloc_tagset(struct nvme_ctrl *nctrl,
 static void nvme_tcp_free_admin_queue(struct nvme_ctrl *ctrl)
 {
 	if (to_tcp_ctrl(ctrl)->async_req.pdu) {
+		cancel_work_sync(&ctrl->async_event_work);
 		nvme_tcp_free_async_req(to_tcp_ctrl(ctrl));
 		to_tcp_ctrl(ctrl)->async_req.pdu = NULL;
 	}
-- 
2.18.1


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  parent reply	other threads:[~2020-09-02 22:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-02 22:42 [PATCH v3 0/3] nvme: cancel async events before freeing event struct David Milburn
2020-09-02 22:42 ` [PATCH v3 1/3] nvme-rdma: " David Milburn
2020-09-02 22:42 ` David Milburn [this message]
2020-09-02 22:42 ` [PATCH v3 3/3] nvme-fc: " David Milburn
2020-09-03 15:29 ` [PATCH v3 0/3] nvme: " Keith Busch
2020-09-03 21:26 ` Sagi Grimberg
2020-09-08 17:47 ` Christoph Hellwig

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=1599086574-85969-3-git-send-email-dmilburn@redhat.com \
    --to=dmilburn@redhat.com \
    --cc=hch@lst.de \
    --cc=james.smart@broadcom.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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;
as well as URLs for NNTP newsgroup(s).