hw/block/nvme: add missing mor/mar constraint check
PATCH 1/1 hw/block/nvme: add missing mor/mar constraint check
From: Klaus Jensen <[email protected]>
The Maximum Open Resources field shall be less than or equal to the Maximum Active Resources field.
Verify that constraint and remove the redundant check that the Maximum Open Resources field does not exceed the number of zones.
Cc Dmitry Fomichev <[email protected]>
Reported-by Gollu Appalanaidu <[email protected]>
Signed-off-by Klaus Jensen <[email protected]>
--- hw/block/nvme-ns.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
hw/block/nvme-ns.c +6 -6
@@ -140,12 +140,6 @@ static int nvme_ns_zoned_check_calc_geometry(NvmeNamespace *ns, Error **errp)return -1 ; } -if (ns->params.max_open_zones > ns->num_zones) { -error_setg (errp, -"max_open_zones value %u exceeds the number of zones %u" , - ns->params.max_open_zones, ns->num_zones); -return -1 ; - }if (ns->params.max_active_zones > ns->num_zones) { error_setg(errp, "max_active_zones value %u exceeds the number of zones %u",
@@ -153,6 +147,12 @@ static int nvme_ns_zoned_check_calc_geometry(NvmeNamespace *ns, Error **errp)return -1 ; } +if (ns->params.max_open_zones > ns->params.max_active_zones) { +error_setg (errp,"max_open_zones (%u) exceeds max_active_zones (%u)" , + ns->params.max_open_zones, ns->params.max_active_zones); +return -1 ; + } +if (ns->params.zd_extension_size) {if (ns->params.zd_extension_size &0x3f ) { error_setg(errp,
Signature · 1 line
2.30.0