diff options
author | Sagi Grimberg <sagi@grimberg.me> | 2016-11-06 04:03:30 -0500 |
---|---|---|
committer | Sagi Grimberg <sagi@grimberg.me> | 2016-11-13 19:08:51 -0500 |
commit | 8242ddac1bfcf6eb8873b4d0a4e7a172c2b5b625 (patch) | |
tree | 05c0b3fae51a96304bee12b75697ad29d723a5a0 | |
parent | 553cd9ef82edd811948782a8f73ae73c4bfeedd3 (diff) |
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: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
-rw-r--r-- | drivers/nvme/target/core.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index b4cacb6f0258..a21437a33adb 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c | |||
@@ -838,9 +838,13 @@ static void nvmet_fatal_error_handler(struct work_struct *work) | |||
838 | 838 | ||
839 | void nvmet_ctrl_fatal_error(struct nvmet_ctrl *ctrl) | 839 | void nvmet_ctrl_fatal_error(struct nvmet_ctrl *ctrl) |
840 | { | 840 | { |
841 | ctrl->csts |= NVME_CSTS_CFS; | 841 | mutex_lock(&ctrl->lock); |
842 | INIT_WORK(&ctrl->fatal_err_work, nvmet_fatal_error_handler); | 842 | if (!(ctrl->csts & NVME_CSTS_CFS)) { |
843 | schedule_work(&ctrl->fatal_err_work); | 843 | ctrl->csts |= NVME_CSTS_CFS; |
844 | INIT_WORK(&ctrl->fatal_err_work, nvmet_fatal_error_handler); | ||
845 | schedule_work(&ctrl->fatal_err_work); | ||
846 | } | ||
847 | mutex_unlock(&ctrl->lock); | ||
844 | } | 848 | } |
845 | EXPORT_SYMBOL_GPL(nvmet_ctrl_fatal_error); | 849 | EXPORT_SYMBOL_GPL(nvmet_ctrl_fatal_error); |
846 | 850 | ||