[PATCH 7/7] Force CCR operation to fail
Randy Jennings
randyj at purestorage.com
Thu Apr 30 16:29:13 PDT 2026
From: Mohamed Khalfella <mkhalfella at 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
More information about the Linux-nvme
mailing list