[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for-6.0 1/7] hw/block/nvme: fix pi constraint check
From: |
Klaus Jensen |
Subject: |
[PATCH for-6.0 1/7] hw/block/nvme: fix pi constraint check |
Date: |
Wed, 24 Mar 2021 21:09:01 +0100 |
From: Klaus Jensen <k.jensen@samsung.com>
Protection Information can only be enabled if there is at least 8 bytes
of metadata.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
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.0
[PATCH for-6.0 3/7] hw/block/nvme: fix the nsid 'invalid' value, Klaus Jensen, 2021/03/24
[PATCH for-6.0 2/7] hw/block/nvme: fix missing string representation for ns attachment, Klaus Jensen, 2021/03/24
[PATCH for-6.0 7/7] hw/block/nvme: fix handling of private namespaces, Klaus Jensen, 2021/03/24
[PATCH for-6.0 6/7] hw/block/nvme: update dmsrl limit on namespace detachment, Klaus Jensen, 2021/03/24
[PATCH for-6.0 4/7] hw/block/nvme: fix controller namespaces array indexing, Klaus Jensen, 2021/03/24