* [PATCH v3 1/3] nvme-rdma: cancel async events before freeing event struct
2020-09-02 22:42 [PATCH v3 0/3] nvme: cancel async events before freeing event struct David Milburn
@ 2020-09-02 22:42 ` David Milburn
2020-09-02 22:42 ` [PATCH v3 2/3] nvme-tcp: " David Milburn
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: David Milburn @ 2020-09-02 22:42 UTC (permalink / raw)
To: linux-nvme, sagi, hch, james.smart
Cancel async event work in case async event has been queued
up, and nvme_rdma_submit_async_event() runs after event has
been freed.
Signed-off-by: David Milburn <dmilburn@redhat.com>
---
drivers/nvme/host/rdma.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 8e5ffe2f117d..9e378d0a0c01 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -835,6 +835,7 @@ static void nvme_rdma_destroy_admin_queue(struct nvme_rdma_ctrl *ctrl,
blk_mq_free_tag_set(ctrl->ctrl.admin_tagset);
}
if (ctrl->async_event_sqe.data) {
+ cancel_work_sync(&ctrl->ctrl.async_event_work);
nvme_rdma_free_qe(ctrl->device->dev, &ctrl->async_event_sqe,
sizeof(struct nvme_command), DMA_TO_DEVICE);
ctrl->async_event_sqe.data = NULL;
--
2.18.1
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v3 2/3] nvme-tcp: cancel async events before freeing event struct
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
2020-09-02 22:42 ` [PATCH v3 3/3] nvme-fc: " David Milburn
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: David Milburn @ 2020-09-02 22:42 UTC (permalink / raw)
To: linux-nvme, sagi, hch, james.smart
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
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v3 3/3] nvme-fc: cancel async events before freeing event struct
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 ` [PATCH v3 2/3] nvme-tcp: " David Milburn
@ 2020-09-02 22:42 ` David Milburn
2020-09-03 15:29 ` [PATCH v3 0/3] nvme: " Keith Busch
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: David Milburn @ 2020-09-02 22:42 UTC (permalink / raw)
To: linux-nvme, sagi, hch, james.smart
Cancel async event work in case async event has been queued
up, and nvme_fc_submit_async_event() runs after event has
been freed.
Signed-off-by: David Milburn <dmilburn@redhat.com>
---
drivers/nvme/host/fc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index a7f474ddfff7..e8ef42b9d50c 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -2160,6 +2160,7 @@ nvme_fc_term_aen_ops(struct nvme_fc_ctrl *ctrl)
struct nvme_fc_fcp_op *aen_op;
int i;
+ cancel_work_sync(&ctrl->ctrl.async_event_work);
aen_op = ctrl->aen_ops;
for (i = 0; i < NVME_NR_AEN_COMMANDS; i++, aen_op++) {
__nvme_fc_exit_request(ctrl, aen_op);
--
2.18.1
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v3 0/3] nvme: cancel async events before freeing event struct
2020-09-02 22:42 [PATCH v3 0/3] nvme: cancel async events before freeing event struct David Milburn
` (2 preceding siblings ...)
2020-09-02 22:42 ` [PATCH v3 3/3] nvme-fc: " David Milburn
@ 2020-09-03 15:29 ` Keith Busch
2020-09-03 21:26 ` Sagi Grimberg
2020-09-08 17:47 ` Christoph Hellwig
5 siblings, 0 replies; 7+ messages in thread
From: Keith Busch @ 2020-09-03 15:29 UTC (permalink / raw)
To: David Milburn; +Cc: james.smart, sagi, linux-nvme, hch
On Wed, Sep 02, 2020 at 05:42:51PM -0500, David Milburn wrote:
> Cancel async event work in case async event has been queued
> up, and transport trys to submit event after it has been freed.
Looks good to me.
Reviewed-by: Keith Busch <kbusch@kernel.org>
> David Milburn (3):
> nvme-rdma: cancel async events before freeing event struct
> nvme-tcp: cancel async events before freeing event struct
> nvme-fc: cancel async events before freeing event struct
>
> drivers/nvme/host/fc.c | 1 +
> drivers/nvme/host/rdma.c | 1 +
> drivers/nvme/host/tcp.c | 1 +
> 3 files changed, 3 insertions(+)
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v3 0/3] nvme: cancel async events before freeing event struct
2020-09-02 22:42 [PATCH v3 0/3] nvme: cancel async events before freeing event struct David Milburn
` (3 preceding siblings ...)
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
5 siblings, 0 replies; 7+ messages in thread
From: Sagi Grimberg @ 2020-09-03 21:26 UTC (permalink / raw)
To: David Milburn, linux-nvme, hch, james.smart
For the series:
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v3 0/3] nvme: cancel async events before freeing event struct
2020-09-02 22:42 [PATCH v3 0/3] nvme: cancel async events before freeing event struct David Milburn
` (4 preceding siblings ...)
2020-09-03 21:26 ` Sagi Grimberg
@ 2020-09-08 17:47 ` Christoph Hellwig
5 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2020-09-08 17:47 UTC (permalink / raw)
To: David Milburn; +Cc: james.smart, sagi, linux-nvme, hch
Thanks, applied the series to nvme-5.9.
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 7+ messages in thread