From: Klaus Jensen <k.jen...@samsung.com> Protection Information can only be enabled if there is at least 8 bytes of metadata.
Signed-off-by: Klaus Jensen <k.jen...@samsung.com> Reviewed-by: Gollu Appalanaidu <anaidu.go...@samsung.com> Reviewed-by: Keith Busch <kbu...@kernel.org> --- hw/block/nvme-ns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c index 7f8d139a8663..ca04ee1bacfb 100644 --- a/hw/block/nvme-ns.c +++ b/hw/block/nvme-ns.c @@ -394,7 +394,7 @@ static int nvme_ns_check_constraints(NvmeNamespace *ns, Error **errp) return -1; } - if (ns->params.pi && !ns->params.ms) { + if (ns->params.pi && ns->params.ms < 8) { error_setg(errp, "at least 8 bytes of metadata required to enable " "protection information"); return -1; -- 2.31.1