nvme: cancel async events before freeing event struct
Subsystems (2)
PATCH v2 1/1 nvme: cancel async events before freeing event struct
Cancel async event work in case async event has been queued up, and transport trys to submit event after it has been freed.
--- drivers/nvme/host/fc.c | 1 + drivers/nvme/host/rdma.c | 1 + drivers/nvme/host/tcp.c | 1 + 3 files changed, 3 insertions(+)
drivers/nvme/host/fc.c +1 -0
@@ -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);
drivers/nvme/host/rdma.c +1 -0
@@ -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 ;
drivers/nvme/host/tcp.c +1 -0
@@ -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 ; }
Signature · 7 lines
2.18.1 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Sagi Grimberg
maintainerQuoted 3 lines
Cancel async event work in case async event has been queued up, and transport trys to submit event after it has been freed.
Can you split to 3 patches please?
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Hi Sagi,
Quoted 6 lines · Sagi Grimberg
Quoted 3 lines
Cancel async event work in case async event has been queued up, and transport trys to submit event after it has been freed.
Can you split to 3 patches please?
OK, re-submitted.
Thanks,
David
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme