All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [PATCH hci-8.1 0/5] scsi-disk: fix UNMAP and WRITE SAME racing with inactivation #VSTOR-151532
@ 2026-10-26 17:49 Denis V. Lunev
  2026-10-26 17:49 ` [PATCH hci-8.1 1/5] scsi-disk: check all UNMAP descriptors before discarding any #VSTOR-151532 Denis V. Lunev
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Denis V. Lunev @ 2026-10-26 17:49 UTC (permalink / raw)
  To: andrey.drobyshev; +Cc: svt-core, den

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/20260421161132.99878-1-kwolf@redhat.com/

Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>
Cc: Fabiano Rosas <farosas@suse.de>
Cc: Laurent Vivier <lvivier@redhat.com>
Cc: qemu-stable@nongnu.org

Denis V. Lunev (5):
  scsi-disk: check all UNMAP descriptors before discarding any
    #VSTOR-151532
  scsi-disk: fix UNMAP racing with inactivation of block nodes
    #VSTOR-151532
  scsi-disk: fix WRITE SAME racing with inactivation of block nodes
    #VSTOR-151532
  virtio-scsi-test: split virtio_scsi_do_command() into submit and wait
    #VSTOR-151532
  virtio-scsi-test: test UNMAP and WRITE SAME during inactivation
    #VSTOR-151532

 hw/scsi/scsi-disk.c            | 278 +++++++++++++++++++--------------
 tests/qtest/virtio-scsi-test.c | 173 +++++++++++++++++---
 2 files changed, 309 insertions(+), 142 deletions(-)

base-commit: 81aea91c7f71cba39b4c3340579d45f0256a91d8

-- 
2.53.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-10-27 10:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26 17:49 [PATCH hci-8.1 0/5] scsi-disk: fix UNMAP and WRITE SAME racing with inactivation #VSTOR-151532 Denis V. Lunev
2026-10-26 17:49 ` [PATCH hci-8.1 1/5] scsi-disk: check all UNMAP descriptors before discarding any #VSTOR-151532 Denis V. Lunev
2026-10-26 17:49 ` [PATCH hci-8.1 2/5] scsi-disk: fix UNMAP racing with inactivation of block nodes #VSTOR-151532 Denis V. Lunev
2026-10-26 17:49 ` [PATCH hci-8.1 3/5] scsi-disk: fix WRITE SAME " Denis V. Lunev
2026-10-26 17:49 ` [PATCH hci-8.1 4/5] virtio-scsi-test: split virtio_scsi_do_command() into submit and wait #VSTOR-151532 Denis V. Lunev
2026-10-26 17:49 ` [PATCH hci-8.1 5/5] virtio-scsi-test: test UNMAP and WRITE SAME during inactivation #VSTOR-151532 Denis V. Lunev
2026-10-27 10:56 ` [PATCH hci-8.1 0/5] scsi-disk: fix UNMAP and WRITE SAME racing with " Andrey Drobyshev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.