Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
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 7/7] Force CCR operation to fail
Date: Thu, 30 Apr 2026 17:29:13 -0600	[thread overview]
Message-ID: <20260430232913.129271-8-randyj@purestorage.com> (raw)
In-Reply-To: <20260430232913.129271-1-randyj@purestorage.com>

From: Mohamed Khalfella <mkhalfella@purestorage.com>

---
 drivers/nvme/target/admin-cmd.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
index 53ec682f27b0..04369ce79ad0 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -626,13 +626,11 @@ static void nvmet_execute_get_log_page_ccr(struct nvmet_req *req)
 	mutex_lock(&ctrl->lock);
 	list_for_each_entry(ccr, &ctrl->ccr_list, entry) {
 		u8 flags = NVME_CCR_FLAGS_VALIDATED | NVME_CCR_FLAGS_INITIATED;
-		u8 status = ccr->ctrl ? NVME_CCR_STATUS_IN_PROGRESS :
-					NVME_CCR_STATUS_SUCCESS;
 
 		log->entries[index].icid = cpu_to_le16(ccr->icid);
 		log->entries[index].ciu = ccr->ciu;
 		log->entries[index].acid = cpu_to_le16(0xffff);
-		log->entries[index].ccrs = status;
+		log->entries[index].ccrs = NVME_CCR_STATUS_FAILED;
 		log->entries[index].ccrf = flags;
 		index++;
 	}
@@ -1725,8 +1723,11 @@ void nvmet_execute_cross_ctrl_reset(struct nvmet_req *req)
 
 out_unlock:
 	mutex_unlock(&sctrl->lock);
-	if (status == NVME_SC_SUCCESS)
-		nvmet_ctrl_fatal_error(ictrl);
+	if (status == NVME_SC_SUCCESS) {
+		nvmet_add_async_event(sctrl, NVME_AER_NOTICE,
+				      NVME_AER_NOTICE_CCR_COMPLETED,
+				      NVME_LOG_CCR);
+	}
 	nvmet_ctrl_put(ictrl);
 out:
 	nvmet_req_complete(req, status);
-- 
2.54.0



  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 ` [PATCH 6/7] nvmet: kill nvme controller when fatal opcode is received Randy Jennings
2026-04-30 23:29 ` Randy Jennings [this message]
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-8-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