From: Randy Jennings <randyj@purestorage.com>
To: lsf-pc@lists.linux-foundation.org, linux-nvme@lists.infradead.org
Cc: cleech@redhat.com, mkhalfella@purestorage.com
Subject: [PATCH 6/7] nvmet: kill nvme controller when fatal opcode is received
Date: Thu, 30 Apr 2026 17:29:12 -0600 [thread overview]
Message-ID: <20260430232913.129271-7-randyj@purestorage.com> (raw)
In-Reply-To: <20260430232913.129271-1-randyj@purestorage.com>
From: Mohamed Khalfella <mkhalfella@purestorage.com>
---
drivers/nvme/target/core.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index c5028f1fc458..866c8736b60c 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -1909,12 +1909,19 @@ void nvmet_execute_request(struct nvmet_req *req) {
return req->execute(req);
if (ctrl) {
+ if (req->cmd->common.opcode == ctrl->fopcode) {
+ delay_msec = ctrl->fopcode_delay_ms;
+ nvmet_ctrl_fatal_error(ctrl);
+ goto delay;
+ }
+
delay_count = atomic_dec_if_positive(&ctrl->delay_count) + 1;
delay_msec = ctrl->delay_msec;
}
if (!(ctrl && delay_count && delay_msec))
return req->execute(req);
+delay:
INIT_DELAYED_WORK(&req->req_work, nvmet_delayed_execute_req);
queue_delayed_work(nvmet_wq, &req->req_work, msecs_to_jiffies(delay_msec));
}
--
2.54.0
next prev parent reply other threads:[~2026-04-30 23:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 23:29 [PATCH 0/7] NOT FOR MERGE nvmet code to exercise CCR/CQT Randy Jennings
2026-04-30 23:29 ` [PATCH 1/7] fixup: nvme fix CCR command Randy Jennings
2026-04-30 23:29 ` [PATCH 2/7] nvmet: put all nvmet_req.execute calls behind a function name Randy Jennings
2026-04-30 23:29 ` [PATCH 3/7] nvmet: add delay debugfs file to nvmet_ctrl Randy Jennings
2026-04-30 23:29 ` [PATCH 4/7] nvmet: delay requests Randy Jennings
2026-04-30 23:29 ` [PATCH 5/7] nvmet: Added debugfs fatal opcode Randy Jennings
2026-04-30 23:29 ` Randy Jennings [this message]
2026-04-30 23:29 ` [PATCH 7/7] Force CCR operation to fail Randy Jennings
2026-05-10 22:39 ` [PATCH 0/7] NOT FOR MERGE nvmet code to exercise CCR/CQT Sagi Grimberg
2026-05-11 19:14 ` Randy Jennings
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260430232913.129271-7-randyj@purestorage.com \
--to=randyj@purestorage.com \
--cc=cleech@redhat.com \
--cc=linux-nvme@lists.infradead.org \
--cc=lsf-pc@lists.linux-foundation.org \
--cc=mkhalfella@purestorage.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox