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

hw/nvme: reimplement dsm to allow cancellation


Prior to this patch, a loop was used to issue multiple "fire and forget"
aios for each range in the command. Without a reference to the aiocb
returned from the blk_aio_pdiscard calls, the aios cannot be canceled.

Fix this by processing the ranges one after another.

As a bonus, this fixes how metadata is cleared (i.e. we only zero it out
if the data was succesfully discarded).

Signed-off-by: default avatarKlaus Jensen <k.jensen@samsung.com>
Reviewed-by: default avatarKeith Busch <kbusch@kernel.org>
parent ff0ac2c8
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