diff options
author | Dmitry Tikhov <d.tihov@yadro.com> | 2022-04-21 13:51:58 +0300 |
---|---|---|
committer | Klaus Jensen <k.jensen@samsung.com> | 2022-06-03 21:48:24 +0200 |
commit | 2e8f952ae7de23b4847937dbbf51f7a1ab10a2af (patch) | |
tree | 1cd31ca7ba9f1b2db7b659df0c9d590e8c1e0a43 /hw | |
parent | 51c453266309166c2737623211c0afc12884cccd (diff) | |
download | qemu-2e8f952ae7de23b4847937dbbf51f7a1ab10a2af.zip qemu-2e8f952ae7de23b4847937dbbf51f7a1ab10a2af.tar.gz qemu-2e8f952ae7de23b4847937dbbf51f7a1ab10a2af.tar.bz2 |
hw/nvme: fix copy cmd for pi enabled namespaces
Current implementation have problem in the read part of copy command.
Because there is no metadata mangling before nvme_dif_check invocation,
reftag error could be thrown for blocks of namespace that have not been
previously written to.
Signed-off-by: Dmitry Tikhov <d.tihov@yadro.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/nvme/ctrl.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 74540a0..08574c4 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -2787,6 +2787,10 @@ static void nvme_copy_in_completed_cb(void *opaque, int ret) size_t mlen = nvme_m2b(ns, nlb); uint8_t *mbounce = iocb->bounce + nvme_l2b(ns, nlb); + status = nvme_dif_mangle_mdata(ns, mbounce, mlen, slba); + if (status) { + goto invalid; + } status = nvme_dif_check(ns, iocb->bounce, len, mbounce, mlen, prinfor, slba, apptag, appmask, &reftag); if (status) { |