All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvmet: Don't queue fatal error work if csts.cfs is set
@ 2016-11-03 21:17 Sagi Grimberg
  2016-11-04  0:01 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Sagi Grimberg @ 2016-11-03 21:17 UTC (permalink / raw)


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.

Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
---
 drivers/nvme/target/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index 4d5be2de25f5..ffc8445a1ac3 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -840,7 +840,9 @@ static void nvmet_fatal_error_handler(struct work_struct *work)
 
 void nvmet_ctrl_fatal_error(struct nvmet_ctrl *ctrl)
 {
-	ctrl->csts |= NVME_CSTS_CFS;
+	if (test_and_set_bit(NVME_CSTS_CFS, (unsigned long *)&ctrl->csts))
+		return;
+
 	INIT_WORK(&ctrl->fatal_err_work, nvmet_fatal_error_handler);
 	schedule_work(&ctrl->fatal_err_work);
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-04 15:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-03 21:17 [PATCH] nvmet: Don't queue fatal error work if csts.cfs is set Sagi Grimberg
2016-11-04  0:01 ` Christoph Hellwig
2016-11-04  0:13   ` Sagi Grimberg
2016-11-04 14:25     ` Steve Wise
2016-11-04 15:54   ` J Freyensee

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.