From: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
To: "Denis V. Lunev" <den@openvz.org>
Cc: svt-core@virtuozzo.com
Subject: Re: [PATCH hci-dev 0/6] block, scsi-disk: honour a size change on child replacement #VSTOR-130961
Date: Wed, 4 Nov 2026 16:00:55 +0200 [thread overview]
Message-ID: <aa871360-7d2b-4fe3-94c6-f413c7d9055f@virtuozzo.com> (raw)
In-Reply-To: <20261104134539.1519657-1-den@openvz.org>
On 11/4/26 3:45 PM, Denis V. Lunev wrote:
> This is the QEMU side of VSTOR-130961. disk_replace puts the real image
> under the device with vz-x-blockdev-replace, which ends up in
> bdrv_replace_child_bs(), and that swaps the node a BdrvChild points to
> without telling the parent anything about it. If the placeholder had a
> different size, the device never learns about it.
>
> scsi-disk is the one really hurt by this. check_lba_range() validates
> every guest request against SCSIDevice.max_lba, filled in by
> scsi_disk_reset() and updated only by the READ CAPACITY(10) and (16)
> handlers, which a migrated guest never reissues. Every request past the
> end of the old node is refused with ILLEGAL REQUEST / LOGICAL BLOCK
> ADDRESS OUT OF RANGE for the whole life of the device, which Linux turns
> into EREMOTEIO. It is silent on the host: no BLOCK_IO_ERROR event, and
> io-status stays 'ok'. This is ASUP-3466, ACSSP-965 and ASUP-3678.
>
> Upstream merged the series as 8b267376df8..28fafb3147f, from
> <20260812121500.1034178-1-den@openvz.org>. Differences:
>
> - Patch 1 is Fiona's 08736e7584c, which exports
> bdrv_co_parent_cb_resize(); our tree predates it.
> - Patch 2: our bdrv_replace_child_bs() only adds its steps to the
> caller's transaction, under the graph write lock, so the length check
> and the notification move to a .commit action. Reading both lengths
> there also covers Kevin's review remark that the upstream version reads
> the old length before draining. His other remark, notifying only the
> replaced BdrvChild, will come with the upstream follow-up.
> - Patch 6 is new: it covers vz-x-blockdev-replace, the path disk_replace
> takes, which the upstream test does not.
>
> Tested on dev-cl04: without patches 1-3 the qtest fails at both the
> qom-set and the vz-x-blockdev-replace step with ILLEGAL REQUEST; with
> them it passes. qos-test quick passes; iotests -g quick for qcow2 and raw
> give the same result with and without the series.
>
> Denis V. Lunev (5):
> block: notify the parent when a replaced child has a different size
> #VSTOR-130961
> scsi-disk: refresh the cached capacity from the resize callback
> #VSTOR-130961
> tests/qtest/virtio-scsi: cover a replacement that changes the size
> #VSTOR-130961
> tests/qemu-iotests/qom-set-drive: replace with a differently sized
> node #VSTOR-130961
> tests/qtest/virtio-scsi: cover vz-x-blockdev-replace changing the size
> #VSTOR-130961
>
> Fiona Ebner (1):
> block: make bdrv_co_parent_cb_resize() a proper IO API function
> #VSTOR-130961
>
> block.c | 27 +++++++
> block/io.c | 9 +--
> hw/scsi/scsi-disk.c | 16 +++-
> include/block/block_int-io.h | 9 +++
> tests/qemu-iotests/tests/qom-set-drive | 14 +++-
> tests/qemu-iotests/tests/qom-set-drive.out | 2 +
> tests/qtest/virtio-scsi-test.c | 85 ++++++++++++++++++++++
> 7 files changed, 149 insertions(+), 13 deletions(-)
>
>
> base-commit: 2ac36f063996449791d0db63fc2c9a67864631d1
Ack
Applied to hci-dev
prev parent reply other threads:[~2026-11-04 14:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 13:45 Denis V. Lunev
2026-11-04 13:45 ` [PATCH hci-dev 1/6] block: make bdrv_co_parent_cb_resize() a proper IO API function #VSTOR-130961 Denis V. Lunev
2026-11-04 13:47 ` no-reply
2026-11-04 13:45 ` [PATCH hci-dev 2/6] block: notify the parent when a replaced child has a different size #VSTOR-130961 Denis V. Lunev
2026-11-04 13:51 ` no-reply
2026-11-04 13:45 ` [PATCH hci-dev 3/6] scsi-disk: refresh the cached capacity from the resize callback #VSTOR-130961 Denis V. Lunev
2026-11-04 13:50 ` no-reply
2026-11-04 13:45 ` [PATCH hci-dev 4/6] tests/qtest/virtio-scsi: cover a replacement that changes the size #VSTOR-130961 Denis V. Lunev
2026-11-04 13:54 ` no-reply
2026-11-04 13:45 ` [PATCH hci-dev 5/6] tests/qemu-iotests/qom-set-drive: replace with a differently sized node #VSTOR-130961 Denis V. Lunev
2026-11-04 13:51 ` no-reply
2026-11-04 13:45 ` [PATCH hci-dev 6/6] tests/qtest/virtio-scsi: cover vz-x-blockdev-replace changing the size #VSTOR-130961 Denis V. Lunev
2026-11-04 13:53 ` no-reply
2026-11-04 14:00 ` 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=aa871360-7d2b-4fe3-94c6-f413c7d9055f@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