nvme: call blk_drain in NVMe reset code to avoid lockups
When blk_flush called in NVMe reset path S/C queues are already freed which means that re-entering AIO handling loop having some IO requests unfinished will lockup or crash as their SG structures being potentially reused. Call blk_drain before freeing the queues to avoid this nasty scenario. Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
e4c8f2925d
commit
6bf7463615
@ -797,6 +797,8 @@ static void nvme_clear_ctrl(NvmeCtrl *n)
|
||||
{
|
||||
int i;
|
||||
|
||||
blk_drain(n->conf.blk);
|
||||
|
||||
for (i = 0; i < n->num_queues; i++) {
|
||||
if (n->sq[i] != NULL) {
|
||||
nvme_free_sq(n->sq[i], n);
|
||||
|
Loading…
Reference in New Issue
Block a user