nvme fixes for 5.9
- cancel async events before freeing them (David Milburn) - revert a broken race fix (James Smart) - fix command processing during resets (Sagi Grimberg) -----BEGIN PGP SIGNATURE----- iQI/BAABCgApFiEEgdbnc3r/njty3Iq9D55TZVIEUYMFAl9Z+RgLHGhjaEBsc3Qu ZGUACgkQD55TZVIEUYP4HA/+N8vgP/Np4ZVWF0mVF7kGNgXhcdlFIZ0DQGlRTBv1 QskC8ylXt8PBmuh+9G54tSTu+Dugw8s+3a4Rz0MIJAbxXUmQy0jVJ1QCMlwaOKrS /RBNPrrT9b/9JISjj27z1hGcB7GQ7b1i/nphhNYZWwZ05gb2U67WfxqjIQrOWaCj QcqTuNPEV3vQ/lNWXCaydEbE0y6ujZTtcNTdJGwouyYVtGUBjNmICAxiDQrpT74e vvnw3EIQtr3Q3RSGXnKGrrnJ5rFRntNFJJxWUcBYcX/t1XArO3VKk0ergnvWm5j7 um6EIFInz9PP55dE+SlyhM0zROZKkN02YJXUP2GwSy8qdBoT4Yi/Gf9bSG0HjTfS lueYbiWKLiaShnXu03VXTKoSH3jh0CB5KYeDH5uiUTf8LeebWbMymlBkSrcCS3LG CQdKLa4tovEoTv7H4dblnOF2UPRsYE3G/9MrU7uNlMhY0YqW6SwsubWFTSS831GK cS5knhTF/eRhbi8UJnPyqRt1szmfYTGWPtCJhCleHHJRm8vkvDyRGRa5nkRlQWcB qROsyTln7aD372hvdLAZqvd66/P3Fo0AejHuw6g3P4iO2g619eVv7Gwxluor+0oa 6zpRHaPToNLESZBQ4cfBmzJ1uhGD4jNxcA169WEXMnRg+8vY9lvWvXGRvGP3BrW1 a9A= =V594 -----END PGP SIGNATURE----- Merge tag 'nvme-5.9-2020-09-10' of git://git.infradead.org/nvme into block-5.9 Pull NVMe fixes from Christoph. "nvme fixes for 5.9 - cancel async events before freeing them (David Milburn) - revert a broken race fix (James Smart) - fix command processing during resets (Sagi Grimberg)" * tag 'nvme-5.9-2020-09-10' of git://git.infradead.org/nvme: nvme-fabrics: allow to queue requests for live queues nvme-tcp: cancel async events before freeing event struct nvme-rdma: cancel async events before freeing event struct nvme-fc: cancel async events before freeing event struct nvme: Revert: Fix controller creation races with teardown flow
This commit is contained in:
commit
fd04358e01
|
@ -3525,10 +3525,6 @@ static ssize_t nvme_sysfs_delete(struct device *dev,
|
|||
{
|
||||
struct nvme_ctrl *ctrl = dev_get_drvdata(dev);
|
||||
|
||||
/* Can't delete non-created controllers */
|
||||
if (!ctrl->created)
|
||||
return -EBUSY;
|
||||
|
||||
if (device_remove_file_self(dev, attr))
|
||||
nvme_delete_ctrl_sync(ctrl);
|
||||
return count;
|
||||
|
@ -4403,7 +4399,6 @@ void nvme_start_ctrl(struct nvme_ctrl *ctrl)
|
|||
nvme_queue_scan(ctrl);
|
||||
nvme_start_queues(ctrl);
|
||||
}
|
||||
ctrl->created = true;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(nvme_start_ctrl);
|
||||
|
||||
|
|
|
@ -565,10 +565,14 @@ bool __nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq,
|
|||
struct nvme_request *req = nvme_req(rq);
|
||||
|
||||
/*
|
||||
* If we are in some state of setup or teardown only allow
|
||||
* internally generated commands.
|
||||
* currently we have a problem sending passthru commands
|
||||
* on the admin_q if the controller is not LIVE because we can't
|
||||
* make sure that they are going out after the admin connect,
|
||||
* controller enable and/or other commands in the initialization
|
||||
* sequence. until the controller will be LIVE, fail with
|
||||
* BLK_STS_RESOURCE so that they will be rescheduled.
|
||||
*/
|
||||
if (!blk_rq_is_passthrough(rq) || (req->flags & NVME_REQ_USERCMD))
|
||||
if (rq->q == ctrl->admin_q && (req->flags & NVME_REQ_USERCMD))
|
||||
return false;
|
||||
|
||||
/*
|
||||
|
@ -577,7 +581,7 @@ bool __nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq,
|
|||
*/
|
||||
switch (ctrl->state) {
|
||||
case NVME_CTRL_CONNECTING:
|
||||
if (nvme_is_fabrics(req->cmd) &&
|
||||
if (blk_rq_is_passthrough(rq) && nvme_is_fabrics(req->cmd) &&
|
||||
req->cmd->fabrics.fctype == nvme_fabrics_type_connect)
|
||||
return true;
|
||||
break;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -307,7 +307,6 @@ struct nvme_ctrl {
|
|||
struct nvme_command ka_cmd;
|
||||
struct work_struct fw_act_work;
|
||||
unsigned long events;
|
||||
bool created;
|
||||
|
||||
#ifdef CONFIG_NVME_MULTIPATH
|
||||
/* asymmetric namespace access: */
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1597,6 +1597,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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue