From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from AM0PR02CU008.outbound.protection.outlook.com (mail-westeuropeazon11023074.outbound.protection.outlook.com [52.101.72.74]) by lore.virtuozzo.com (Postfix) with ESMTPS id A57A28045D for ; Wed, 4 Nov 2026 13:45:52 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ty46VAZWCuCyucd+qYlQMw/jxHnzx9Hrvb8eRN0JBjE+I2FHczcwMVh0s+F+7hlVEsU5WcCZ+/6vFPyKipdsQBUdzGL9r6bMFwAJAwO95D5Hi75QD84veXsLrTM4pRyKpsmP4Ndtk0ENL2frsyjF5JcU7Hjip7lIjU69men/p02ovB8wM8uGohxMh7YD+1h17u3gkj4OcrztsHfHeS2BaPB239A/65DK+xK6d6aXQfwfdnLHpK+aIIy8PLxkx817wwbR6BlKbj4NRtMRq7gsKgVEbjBL4ePyS6t7gvp9seyivk6iGS1oMpIweGkBbP8U7JaOmIBA6dKH1DyAU0zlmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7cKs2zjF69U+gTvLVx+GgvOgTGoQC4nBEl+2GvVSmuM=; b=BOWJo4HkLrHG3FrzsXSr/ezC9/J5mVYKXHU9uCyCDSZzxquomEXpgCmg5kC8neDoqM/Pt14GMCfagoWyiUdWpDWZK8MaF7Rwsw7smR1pPyCLzvC4VFbtlHVwywEsBmjA7MynwttELGd/n3+SyTVCJx12pWO3Kv+vZv7Dt/QFREPeNqsLPTGZk14HcNohSrZL78EVNDZeNEiDTBXvr67fbNWmWxEqTAiKhZ2ajEU8o6m2AjwHKl5Dul9zIi5x3bwVLUBmZwd+uRJ5Jhwt+yyEk+SteK5RU+TK6BCspaOSbMxyPWPRGlzsxqhqMF/SXGnvO+U31EYpVBkhA4ODiYOjgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 2a00:1450:4864:20::436) smtp.rcpttodomain=virtuozzo.com smtp.mailfrom=openvz.org; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=openvz.org; dkim=pass (signature was verified) header.d=openvz.org; arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.onmicrosoft.com; s=selector2-virtuozzo-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7cKs2zjF69U+gTvLVx+GgvOgTGoQC4nBEl+2GvVSmuM=; b=Meklq/StRw+cGspzv0f469cSh2gdAeKQkWA8bOmmZRbHcUtnvW9m0VE7qn9+rTEZ//XzBOaK1Oa1Zpmfz4eNH0DDSgy8I1sBKjN1zSjfxdm51OvKNBy9T1yPQeFftr4dhBrMzwAaOhAHaOsRPbhnV6VrF4FyCh6uymWop/uRF6c= Received: from AM0PR10CA0050.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:150::30) by AS8PR08MB6374.eurprd08.prod.outlook.com (2603:10a6:20b:338::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.569.12; Wed, 4 Nov 2026 13:45:44 +0000 Received: from AM1PEPF000C1ADA.eurprd02.prod.outlook.com (2603:10a6:20b:150:cafe::40) by AM0PR10CA0050.outlook.office365.com (2603:10a6:20b:150::30) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.592.9 via Frontend Transport; Wed, 4 Nov 2026 13:45:44 +0000 Authentication-Results: spf=pass (sender IP is 2a00:1450:4864:20::436) smtp.mailfrom=openvz.org; dkim=pass (signature was verified) header.d=openvz.org;dmarc=pass action=none header.from=openvz.org; Received-SPF: Pass (protection.outlook.com: domain of openvz.org designates 2a00:1450:4864:20::436 as permitted sender) receiver=protection.outlook.com; client-ip=2a00:1450:4864:20::436; helo=mail-wr1-x436.google.com; pr=C Received: from mail-wr1-x436.google.com (2a00:1450:4864:20::436) by AM1PEPF000C1ADA.mail.protection.outlook.com (2603:10a6:20f:fff8::259) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.592.5 via Frontend Transport; Wed, 4 Nov 2026 13:45:42 +0000 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-490d59c3edaso75541f8f.1 for ; Wed, 04 Nov 2026 05:45:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1793799942; x=1794404742; darn=virtuozzo.com; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=7cKs2zjF69U+gTvLVx+GgvOgTGoQC4nBEl+2GvVSmuM=; b=FjONhQxGv1ttOAj8p84J1F015yisVJHrNhkna4h54ibJWg47eiptl2RpSC+uzysxnC s6M7RqDabVqF2AAs1bhx4kRZayKs17D4t0+LQbS3lUvmhajNQSKqYAG6dR3u22vPVXqC 38KuOvcP9qmBYiB1g0n6yPDUp7mTkbmcCF/zcy8vFAtuPrvpCIU9m1MWP7B8TA3kcSUX L2aR57TbFsUrmpqwknHOCe2Lo6ckCVLPkC6f0nzbz188u3Nprql5GhsRzGq4KuS4AwQX WItEHzmR9+e0zIMCrba02/UwX0KsonYSD7391WXi38p+YqA8nWyfxaTjUWTnbU5ENv0z vo1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793799942; x=1794404742; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=7cKs2zjF69U+gTvLVx+GgvOgTGoQC4nBEl+2GvVSmuM=; b=FB0ro0Q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kAK9kZcnd5BT8iLE+7VBC9Zjwyfu/Tl ePjG4DDbDpqqSaB4p42ZTSSKeg== X-Received: by 2002:a5d:64c9:0:b0:48c:585b:8825 with SMTP id ffacd0b85a97d-48e6e2db4a1mr43703662f8f.18.1793799942087; Wed, 04 Nov 2026 05:45:42 -0800 (PST) Received: from athena.sw.ru ([2a06:5b06:b600:300:162e:5a6e:fd46:18b7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48feeb51a9csm4005178f8f.59.2026.11.04.05.45.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2026 05:45:41 -0800 (PST) From: "Denis V. Lunev" To: andrey.drobyshev@virtuozzo.com Cc: svt-core@virtuozzo.com, den@openvz.org Subject: [PATCH hci-dev 0/6] block, scsi-disk: honour a size change on child replacement #VSTOR-130961 Date: Wed, 4 Nov 2026 14:45:33 +0100 Message-ID: <20261104134539.1519657-1-den@openvz.org> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-EOPTenantAttributedMessage: 0bc7f26d-0264-416e-a6fc-8352af79c58f:0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM1PEPF000C1ADA:EE_|AS8PR08MB6374:EE_ X-MS-Office365-Filtering-Correlation-Id: a03b759b-d8cd-4148-91c1-08df3a79eb86 X-LD-Processed: 0bc7f26d-0264-416e-a6fc-8352af79c58f,ExtAddr X-MS-Exchange-AtpMessageProperties: SA X-MS-Exchange-SenderADCheck: 0 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|704161411799003|48200799018|6059299003|376014|61400799027|9140799003|43022699015|82310400026|261026135527099003|261026140227099003|56012099006|261009223027099003|261028144727099003|261026121527099003|5063699009|261022075727099003|261022115727099003|261022105027099003|261021121427099003|261021123027099003|10067099003|55112099003|18002099003|261102123227099003|16102099003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zFLbnphU09URkg1d1pqOXI0M2ErTGQ0MjlHMytoZ0VSSnRSdlFMNlVp?= =?utf-8?B?bFRRdUUrbW5KeWJUZ2h0MngycHV5cWEyV0FkdGg0K0hhRVFBTUQ1MUU1VVZL?= =?utf-8?B?ZVpJcUlyUExUUXdVZ0YzS3JlYnZBYjVNTi9HVkgwaWU5WnhheG5Gd09RNG84?= =?utf-8?B?d3NkTkRqRXZzRG1sTU5LMCt6dmdWTmVVS2pwUU9CVm1JZ3JackFzWnBmL2RU?= =?utf-8?B?blFXb0pQSGMzRFltS3BVUHJ2YVlkNGZpOWgybmtMRUREb3BUNHFBVDFoOUl3?= =?utf-8?B?ZXJoeVg3VWt4K1JSeVV1c29uTmVWcFJOSzR3VUFIRGtaVDRkeW94U0F0cTNl?= =?utf-8?B?andNMENSQkZxaytmL1VaZjJpcHpyamxObjNabEs5K3BMbGRLUDJNMU4ra2tn?= =?utf-8?B?MTF1U3pVWjVETS80NitRdFRPTnFUMTZPL01GYUNYeWlMaFJSMzVCeVhzbjMv?= =?utf-8?Q?MCLChLI8c7yvPMaw1vvh9aHbZgZRhcDc8l?= X-Forefront-Antispam-Report: CIP:2a00:1450:4864:20::436;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail-wr1-x436.google.com;PTR:mail-wr1-x436.google.com;CAT:NONE;SFS:(13230040)(704161411799003)(48200799018)(6059299003)(376014)(61400799027)(9140799003)(43022699015)(82310400026)(261026135527099003)(261026140227099003)(56012099006)(261009223027099003)(261028144727099003)(261026121527099003)(5063699009)(261022075727099003)(261022115727099003)(261022105027099003)(261021121427099003)(261021123027099003)(10067099003)(55112099003)(18002099003)(261102123227099003)(16102099003)(261102130727099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jbhxUWug/9dSP0sDfm/AYWGaYu5yTLYX8qcxWZkxivYYWxsuQaObBTH17VuhWAb5Eqk4uCS/NBlgiXPewrq+vDme1/64KC15EfI1g+OrMtBH54lsHkWEXo3bmcTt62Rgw5YsULGMNaWU2eEsn4r577GOZoxNLDkFwqHhNF6L6f4lPmJhU8h2pepQq9jLXN7EEK5cA0qAnmUyoWBQ4HnEfnxMEWNF1s/7C4e0g0TOYa9UXLgVQS78iVJZE2J0jwFn576kvaiT8E9tvPE1o51JcJk3D7d7TaIxOLpHSlkk6E2kPD8un0+lT7EKu5s2neexLeS9oD1y+3H+0WhfYY8reDGvfiWk+nc0JXucZWjJGaVLKtTm0akr+mh9u/qx8J6IY/gRxTWmeW2HQYtPDVRyq6pX94+CSbGD0eRh7Cvs/SJou4dyWxSGsiOsMRo1oRXx X-ExternalRecipientOutboundConnectors: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-Auto-Response-Suppress: DR, OOF, AutoReply X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2026 13:45:42.6476 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a03b759b-d8cd-4148-91c1-08df3a79eb86 X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: AM1PEPF000C1ADA.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6374 List-Id: 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 -- 2.53.0