scsi: fix device removal race vs IO restart callback on resume
commitcfd4e36352d4426221aa94da44a172da1aaa741b
authorMaxim Levitsky <mlevitsk@redhat.com>
Thu, 10 Dec 2020 12:59:29 +0000 (10 14:59 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 15 Dec 2020 17:52:04 +0000 (15 12:52 -0500)
tree882248de2cf2c5dda57f34a8818d19470e076965
parent835cbd8d44b62217b8774b39e1bfd314750c2c51
scsi: fix device removal race vs IO restart callback on resume

There is (mostly theoretical) race between removal of a scsi device and
scsi_dma_restart_bh.

It used to be easier to hit this race prior to my / Paulo's patch series
that added rcu to scsi bus device handling code, but IMHO this race
should still be possible to hit, at least in theory.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1854811
Fix it anyway with a patch that was proposed by Paulo in the above bugzilla.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20201210125929.1136390-2-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/scsi/scsi-bus.c