All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: "Denis V. Lunev" <den@openvz.org>, qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org
Subject: Re: [PATCH 2/4] scsi-disk: refresh the cached capacity from the resize callback
Date: Wed, 26 Aug 2026 12:45:11 +0200	[thread overview]
Message-ID: <127cbc97-6d47-4b2a-8697-47c015ad3264@oss.qualcomm.com> (raw)
In-Reply-To: <20260812121500.1034178-3-den@openvz.org>

On 12/8/26 14:14, Denis V. Lunev wrote:
> scsi_disk_resize_cb() reports CAPACITY DATA HAS CHANGED but leaves
> SCSIDevice.max_lba alone, and max_lba is what check_lba_range() compares
> every request against. Until the guest reacts to the unit attention and
> issues READ CAPACITY, requests beyond the old size keep being refused with
> LOGICAL BLOCK ADDRESS OUT OF RANGE, and a guest which never re-reads the
> capacity never recovers at all. A guest migrated onto a device whose size
> changed underneath it is exactly such a guest.
> 
> ide_resize_cb() refreshes its cached size along with the IDENTIFY data it
> reports to the guest. Do the same here, so that the notification is what
> tells the guest about the new capacity rather than what unblocks the
> device.
> 
> Factor the computation out of scsi_disk_reset(), which already had it.
> 
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> ---
>   hw/scsi/scsi-disk.c | 16 ++++++++++++----
>   1 file changed, 12 insertions(+), 4 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>


  reply	other threads:[~2026-08-26 10:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 12:14 [PATCH 0/4] block, scsi-disk: honour a size change on child replacement Denis V. Lunev
2026-08-12 12:14 ` [PATCH 1/4] block: notify the parent when a replaced child has a different size Denis V. Lunev
2026-08-26 10:53   ` Philippe Mathieu-Daudé
2026-08-12 12:14 ` [PATCH 2/4] scsi-disk: refresh the cached capacity from the resize callback Denis V. Lunev
2026-08-26 10:45   ` Philippe Mathieu-Daudé [this message]
2026-08-12 12:14 ` [PATCH 3/4] tests/qtest/virtio-scsi: cover a replacement that changes the size Denis V. Lunev
2026-08-26 10:46   ` Philippe Mathieu-Daudé
2026-08-12 12:15 ` [PATCH 4/4] tests/qemu-iotests/qom-set-drive: replace with a differently sized node Denis V. Lunev
2026-08-26 10:47   ` Philippe Mathieu-Daudé
2026-08-19  9:36 ` [PATCH 0/4] block, scsi-disk: honour a size change on child replacement Denis V. Lunev
2026-08-26 10:22 ` Denis V. Lunev
2026-09-02 15:39 ` Denis V. Lunev

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=127cbc97-6d47-4b2a-8697-47c015ad3264@oss.qualcomm.com \
    --to=philmd@oss.qualcomm.com \
    --cc=den@openvz.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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 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.