Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8242ddac authored by Sagi Grimberg's avatar Sagi Grimberg
Browse files

nvmet: Don't queue fatal error work if csts.cfs is set



In the transport, in case of an interal queue error like
error completion in rdma we trigger a fatal error. However,
multiple queues in the same controller can serr error completions
and we don't want to trigger fatal error work more than once.

Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
parent 553cd9ef
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -838,10 +838,14 @@ static void nvmet_fatal_error_handler(struct work_struct *work)

void nvmet_ctrl_fatal_error(struct nvmet_ctrl *ctrl)
{
	mutex_lock(&ctrl->lock);
	if (!(ctrl->csts & NVME_CSTS_CFS)) {
		ctrl->csts |= NVME_CSTS_CFS;
		INIT_WORK(&ctrl->fatal_err_work, nvmet_fatal_error_handler);
		schedule_work(&ctrl->fatal_err_work);
	}
	mutex_unlock(&ctrl->lock);
}
EXPORT_SYMBOL_GPL(nvmet_ctrl_fatal_error);

static struct nvmet_subsys *nvmet_find_get_subsys(struct nvmet_port *port,