All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, "Denis V. Lunev" <den@openvz.org>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Hanna Reitz" <hreitz@redhat.com>,
	"Eric Blake" <eblake@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
Subject: [PATCH 3/3] block: notify only the replaced child in bdrv_replace_child_bs()
Date: Thu,  5 Nov 2026 21:37:52 +0100	[thread overview]
Message-ID: <20261105203752.3169635-4-den@openvz.org> (raw)
In-Reply-To: <20261105203752.3169635-1-den@openvz.org>

From: Denis V. Lunev <den@openvz.org>

bdrv_replace_child_bs() compares the sizes of the old and the new node
to decide whether @child has to be told, and then notifies every parent
of new_bs. The other parents already had that node and its size, so
they get a resize event for nothing: a scsi-hd sharing the new node
reports CAPACITY DATA HAS CHANGED to its guest although the capacity is
the same.

Notify @child alone. bdrv_parent_cb_resize() has no user left, so drop
it.

Fixes: 8b267376df87 ("block: notify the parent when a replaced child has a different size")
Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 block.c                      | 2 +-
 include/block/block_int-io.h | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/block.c b/block.c
index 9df1a48c06..c3e7059556 100644
--- a/block.c
+++ b/block.c
@@ -5590,7 +5590,7 @@ int bdrv_replace_child_bs(BdrvChild *child, BlockDriverState *new_bs,
         int64_t new_len = bdrv_getlength(new_bs);
 
         if (new_len >= 0 && new_len != old_len) {
-            bdrv_parent_cb_resize(new_bs);
+            bdrv_child_notify_resize(child);
         }
     }
 
diff --git a/include/block/block_int-io.h b/include/block/block_int-io.h
index 3cb72fecd4..6aa7b2184e 100644
--- a/include/block/block_int-io.h
+++ b/include/block/block_int-io.h
@@ -206,7 +206,4 @@ bdrv_co_child_notify_resize(BdrvChild *c);
 void co_wrapper_bdrv_rdlock
 bdrv_child_notify_resize(BdrvChild *c);
 
-void co_wrapper_bdrv_rdlock
-bdrv_parent_cb_resize(BlockDriverState *bs);
-
 #endif /* BLOCK_INT_IO_H */
-- 
2.53.0



  parent reply	other threads:[~2026-11-05 20:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05 20:37 [PATCH 0/3] block: fix the size change notification in bdrv_replace_child_bs() Denis V. Lunev
2026-11-05 20:37 ` [PATCH 1/3] block: read the old child length after draining " Denis V. Lunev
2026-11-05 20:37 ` [PATCH 2/3] block: add bdrv_child_notify_resize() to notify a single parent Denis V. Lunev
2026-11-05 20:37 ` Denis V. Lunev [this message]
2026-11-17 11:00 ` [PATCH 0/3] block: fix the size change notification in bdrv_replace_child_bs() Kevin Wolf

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=20261105203752.3169635-4-den@openvz.org \
    --to=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=philmd@oss.qualcomm.com \
    --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.