[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for-7.2 v2 2/6] hw/nvme: fix cancellation of format operations
From: |
Klaus Jensen |
Subject: |
[PATCH for-7.2 v2 2/6] hw/nvme: fix cancellation of format operations |
Date: |
Thu, 10 Nov 2022 08:05:19 +0100 |
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 918af03d32be..819c02067191 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -5762,8 +5762,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.38.1
- [PATCH for-7.2 v2 0/6] hw/nvme: misc fixes, Klaus Jensen, 2022/11/10
- [PATCH for-7.2 v2 1/6] hw/nvme: fix accidental reintroduction of redundant code, Klaus Jensen, 2022/11/10
- [PATCH for-7.2 v2 2/6] hw/nvme: fix cancellation of format operations,
Klaus Jensen <=
- [PATCH for-7.2 v2 4/6] hw/nvme: fix cancellation handling in zone reset, Klaus Jensen, 2022/11/10
- [PATCH for-7.2 v2 6/6] hw/nvme: fix numzrwa handling, Klaus Jensen, 2022/11/10
- [PATCH for-7.2 v2 5/6] hw/nvme: fix cancellation handling in dsm, Klaus Jensen, 2022/11/10
- [PATCH for-7.2 v2 3/6] hw/nvme: fix flush cancel, Klaus Jensen, 2022/11/10