More descriptive err msg for NVMe format
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
This commit is contained in:
parent
28eee81fea
commit
637ca6e2f4
@ -1628,7 +1628,7 @@ static int handle_nvme_format()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!cas_capabilites.nvme_format) {
|
if (!cas_capabilites.nvme_format) {
|
||||||
cas_printf(LOG_ERR, "Command is not supported\n");
|
cas_printf(LOG_ERR, "Command is not supported by current kernel\n");
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,6 +183,10 @@ struct {
|
|||||||
KCAS_ERR_NVME_BAD_FORMAT,
|
KCAS_ERR_NVME_BAD_FORMAT,
|
||||||
"NVMe is formatted to unsupported format"
|
"NVMe is formatted to unsupported format"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
KCAS_ERR_UNSUPPORTED_LBA_FORMAT,
|
||||||
|
"Specified LBA format is not supported by the NVMe device"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
KCAS_ERR_CONTAINS_PART,
|
KCAS_ERR_CONTAINS_PART,
|
||||||
"Device contains partitions.\nIf you want to continue, "
|
"Device contains partitions.\nIf you want to continue, "
|
||||||
|
@ -274,7 +274,7 @@ static int _cas_nvme_preformat_check(struct block_device *bdev, int force)
|
|||||||
} else if (probe_ctx.error == -EBUSY) {
|
} else if (probe_ctx.error == -EBUSY) {
|
||||||
ret = -OCF_ERR_NOT_OPEN_EXC;
|
ret = -OCF_ERR_NOT_OPEN_EXC;
|
||||||
} else if (probe_ctx.error) {
|
} else if (probe_ctx.error) {
|
||||||
/* Some error occurred, we do not have sure about clean cache */
|
/* Some error occurred, we are not sure whether cache is clean or not */
|
||||||
ret = -KCAS_ERR_FORMAT_FAILED;
|
ret = -KCAS_ERR_FORMAT_FAILED;
|
||||||
} else {
|
} else {
|
||||||
/* Check if cache was closed in proper way */
|
/* Check if cache was closed in proper way */
|
||||||
@ -352,7 +352,7 @@ static int _cas_nvme_format_namespace_by_path(const char *device_path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (best_lbaf < 0) {
|
if (best_lbaf < 0) {
|
||||||
ret = -KCAS_ERR_FORMAT_FAILED;
|
ret = -KCAS_ERR_UNSUPPORTED_LBA_FORMAT;
|
||||||
goto out2;
|
goto out2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -509,7 +509,7 @@ static int _cas_nvme_format_character_device(const char *device_path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (best_lbaf < 0) {
|
if (best_lbaf < 0) {
|
||||||
ret = -KCAS_ERR_FORMAT_FAILED;
|
ret = -KCAS_ERR_UNSUPPORTED_LBA_FORMAT;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -544,6 +544,9 @@ enum kcas_error {
|
|||||||
/** NVMe is formatted to unsupported format */
|
/** NVMe is formatted to unsupported format */
|
||||||
KCAS_ERR_NVME_BAD_FORMAT,
|
KCAS_ERR_NVME_BAD_FORMAT,
|
||||||
|
|
||||||
|
/** Specified LBA format is not supported by the NVMe device */
|
||||||
|
KCAS_ERR_UNSUPPORTED_LBA_FORMAT,
|
||||||
|
|
||||||
/** Device contains partitions */
|
/** Device contains partitions */
|
||||||
KCAS_ERR_CONTAINS_PART,
|
KCAS_ERR_CONTAINS_PART,
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user