Virtuozzo QEMU development (svt-core@virtuozzo.com)
 help / color / mirror / Atom feed
From: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
To: "Denis V. Lunev" <den@openvz.org>
Cc: svt-core@virtuozzo.com
Subject: Re: [PATCH hci-8.1 0/5] scsi-disk: fix UNMAP and WRITE SAME racing with inactivation #VSTOR-151532
Date: Tue, 27 Oct 2026 12:56:48 +0200	[thread overview]
Message-ID: <41481659-a1e7-4ee8-948b-4bcba5f94023@virtuozzo.com> (raw)
In-Reply-To: <20261026174929.685720-1-den@openvz.org>

Let's hear what the upstream block maintainers have to say about this first:

https://lore.kernel.org/qemu-devel/20261026174220.674460-1-den@openvz.org

Andrey

On 10/26/26 7:49 PM, Denis V. Lunev wrote:
> 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
> 


      parent reply	other threads:[~2026-10-27 10:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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
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 ` Andrey Drobyshev [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41481659-a1e7-4ee8-948b-4bcba5f94023@virtuozzo.com \
    --to=andrey.drobyshev@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=svt-core@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox