[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/12] hw/nvme: fix cancellation of format operations
From: |
Klaus Jensen |
Subject: |
[PATCH 06/12] hw/nvme: fix cancellation of format operations |
Date: |
Thu, 23 Jun 2022 23:18:15 +0200 |
From: Klaus Jensen <k.jensen@samsung.com>
Cancelling a format operation neglects to set iocb->ret as well as
clearing the iocb->aiocb after cancelling the underlying aiocb.
Fix this.
Fixes: 3bcf26d3d619 ("hw/nvme: reimplement format nvm to allow cancellation")
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
hw/nvme/ctrl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index f10334fc1d3f..a85eabfa8bfd 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -5640,8 +5640,11 @@ static void nvme_format_cancel(BlockAIOCB *aiocb)
{
NvmeFormatAIOCB *iocb = container_of(aiocb, NvmeFormatAIOCB, common);
+ iocb->ret = -ECANCELED;
+
if (iocb->aiocb) {
blk_aio_cancel_async(iocb->aiocb);
+ iocb->aiocb = NULL;
}
}
--
2.36.1
- [PATCH 00/12] hw/nvme: misc fixes and updates, Klaus Jensen, 2022/06/23
- [PATCH 01/12] hw/nvme: fix incorrect use of errp/local_err, Klaus Jensen, 2022/06/23
- [PATCH 02/12] hw/nvme: remove redundant passing of PCIDevice, Klaus Jensen, 2022/06/23
- [PATCH 03/12] hw/nvme: cleanup error reporting in nvme_init_pci(), Klaus Jensen, 2022/06/23
- [PATCH 04/12] hw/nvme: fix numzrwa handling, Klaus Jensen, 2022/06/23
- [PATCH 05/12] hw/nvme: fix accidental reintroduction of redundant code, Klaus Jensen, 2022/06/23
- [PATCH 06/12] hw/nvme: fix cancellation of format operations,
Klaus Jensen <=
- [PATCH 07/12] hw/nvme: fix flush cancel, Klaus Jensen, 2022/06/23
- [PATCH 08/12] hw/nvme: rework flush bh scheduling, Klaus Jensen, 2022/06/23
- [PATCH 09/12] hw/nvme: improve cancellation handling in zone reset, Klaus Jensen, 2022/06/23
- [PATCH 10/12] hw/nvme: improve cancellation handling in dsm, Klaus Jensen, 2022/06/23
- [PATCH 11/12] hw/nvme: simplify copy command error handling, Klaus Jensen, 2022/06/23
- [PATCH 12/12] hw/nvme: align logic of format with flush, Klaus Jensen, 2022/06/23