Skip to content
Snippets Groups Projects
Commit 433c71e4 authored by Klaus Jensen's avatar Klaus Jensen
Browse files

hw/nvme: fix aio cancel in format


There are several bugs in the async cancel code for the Format command.

Firstly, cancelling a format operation neglects to set iocb->ret as well
as clearing the iocb->aiocb after cancelling the underlying aiocb which
causes the aio callback to ignore the cancellation. Trivial fix.

Secondly, and worse, because the request is queued up for posting to the
CQ in a bottom half, if the cancellation is due to the submission queue
being deleted (which calls blk_aio_cancel), the req structure is
deallocated in nvme_del_sq prior to the bottom half being schedulued.

Fix this by simply removing the bottom half, there is no reason to defer
it anyway.

Fixes: 3bcf26d3 ("hw/nvme: reimplement format nvm to allow cancellation")
Reported-by: default avatarJonathan Derrick <jonathan.derrick@linux.dev>
Reviewed-by: default avatarKeith Busch <kbusch@kernel.org>
Signed-off-by: default avatarKlaus Jensen <k.jensen@samsung.com>
parent c4ffd91a
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment