nvme: fix WRITE_TO_RO_RANGE status code

WRITE_TO_RO_PAGE was incorrect and misleading.  This
0x82 NVMe status code indicates a write to a read-only
range of LBAs.  So modify the constant name and
associated usages to use WRITE_TO_RO_RANGE instead.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I993dbebb5acc2e685a0e99aa14084942ef79d659
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/465083
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Jim Harris 2019-08-13 03:01:18 -07:00
parent 87b7f28695
commit 0aa72ffb74
3 changed files with 3 additions and 3 deletions

View File

@ -654,7 +654,7 @@ enum spdk_nvme_command_specific_status_code {
SPDK_NVME_SC_CONFLICTING_ATTRIBUTES = 0x80,
SPDK_NVME_SC_INVALID_PROTECTION_INFO = 0x81,
SPDK_NVME_SC_ATTEMPTED_WRITE_TO_RO_PAGE = 0x82,
SPDK_NVME_SC_ATTEMPTED_WRITE_TO_RO_RANGE = 0x82,
};
/**

View File

@ -158,7 +158,7 @@ spdk_scsi_nvme_translate(const struct spdk_bdev_io *bdev_io, int *sc, int *sk,
*asc = SPDK_SCSI_ASC_INVALID_FIELD_IN_CDB;
*ascq = SPDK_SCSI_ASCQ_CAUSE_NOT_REPORTABLE;
break;
case SPDK_NVME_SC_ATTEMPTED_WRITE_TO_RO_PAGE:
case SPDK_NVME_SC_ATTEMPTED_WRITE_TO_RO_RANGE:
*sc = SPDK_SCSI_STATUS_CHECK_CONDITION;
*sk = SPDK_SCSI_SENSE_DATA_PROTECT;
*asc = SPDK_SCSI_ASC_WRITE_PROTECTED;

View File

@ -239,7 +239,7 @@ static const struct nvme_string command_specific_status[] = {
{ SPDK_NVME_SC_INVALID_RESOURCE_ID, "INVALID RESOURCE IDENTIFIER" },
{ SPDK_NVME_SC_CONFLICTING_ATTRIBUTES, "CONFLICTING ATTRIBUTES" },
{ SPDK_NVME_SC_INVALID_PROTECTION_INFO, "INVALID PROTECTION INFO" },
{ SPDK_NVME_SC_ATTEMPTED_WRITE_TO_RO_PAGE, "WRITE TO RO PAGE" },
{ SPDK_NVME_SC_ATTEMPTED_WRITE_TO_RO_RANGE, "WRITE TO RO RANGE" },
{ 0xFFFF, "COMMAND SPECIFIC" }
};