scsi-disk: fix UNMAP and WRITE SAME racing with inactivation
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest5 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | scsi-disk: check all UNMAP descriptors before discarding anyhw/ | +14 | 0 replies | |
| 2/5 | scsi-disk: fix UNMAP racing with inactivation of block nodeshw/ | +112 | 0 replies | |
| 3/5 | scsi-disk: fix WRITE SAME racing with inactivation of block nodeshw/ | +39 | 0 replies | |
| 4/5 | virtio-scsi-test: split virtio_scsi_do_command() into submit and waittests/ | +59 | 0 replies | |
| 5/5 | virtio-scsi-test: test UNMAP and WRITE SAME during inactivationtests/ | +88 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/5] scsi-disk: fix UNMAP and WRITE SAME racing with inactivation
scsi-disk splits UNMAP into one discard per descriptor and a non-zero WRITE SAME into 512 KiB writes, submitting each step from the completion callback of the previous one. A drain in between only waits for the step in flight; the next one is queued by blk_wait_while_drained() and resumed by drain_end. When the drain is the one in bdrv_inactivate_all() (end of live migration, blockdev-set-active), the resumed request hits an inactive node:
bdrv_co_write_req_prepare: Assertion
`!(bs->open_flags & BDRV_O_INACTIVE)' failed.
We hit this in production on a guest UNMAP with 38 descriptors.
The fix follows the one Kevin did for IDE TRIM:
https://lore.kernel.org/qemu-devel/[email protected]/
Denis V. Lunev (5):
scsi-disk: check all UNMAP descriptors before discarding any
scsi-disk: fix UNMAP racing with inactivation of block nodes
scsi-disk: fix WRITE SAME racing with inactivation of block nodes
virtio-scsi-test: split virtio_scsi_do_command() into submit and wait
virtio-scsi-test: test UNMAP and WRITE SAME during inactivation
hw/scsi/scsi-disk.c | 277 +++++++++++++++++++-------------- tests/qtest/virtio-scsi-test.c | 173 ++++++++++++++++---- 2 files changed, 308 insertions(+), 142 deletions(-)
base-commit: d73149283205645625bfa9fe029cfb68e4c4a9ae
Signature · 1 line
2.53.0