From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <010701a22f243cea-a121e4cd-5006-4088-ba16-6140a4dd09f4-000000@eu-central-1.amazonses.com> Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11022096.outbound.protection.outlook.com [52.101.66.96]) by lore.virtuozzo.com (Postfix) with ESMTPS id 68B8A80063 for ; Tue, 1 Dec 2026 01:07:18 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zKn/CwWFemgsB2RfiZ3KO3fBSUHECvHUWC46TC3JUm3lpDe0YAcxNemKtlCSu8xqry+dxPS4Faf9nVQYLC0+PI6FHTHhn/NAPL+9RTqiBxCiZ+tHNLm7yfl9t1tIB8ZhwgwqpQNg+EGaiq9zqOvjWBKakGfxl4ZhIMKeoStPRqggH/BM8OdpWfS1x2aQDu/sDKjMP57bq8uWDN5tVHCwjm3Vn5FBLef5GFLZfroQuIpw4VG61WcZlMeldFYSjTO20AXKyGHgkYw+wz201Z82GYo7daW12FfZLyGmtxA0r0sPSjQkYTpqjfhdzmHtsnQwx4RgQ0udavv4D7U6ee+ilg== 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=Is+frNRDgaAlrvmh89Pa1Ky7zCnnbnPwsGp0zLQeWtE=; b=ZCYZKb9/C9iyDSAElPi3p7z5+ARlFPyX4ivwwYLcYgvTdkIk3+vTC4I4W9Q5QF9W0e3Jt7QtErzDij4Y6NQIvpAe91F9U913zpRNzPLY9yTN5Gs5i3tftgngO6oQruE8qyfhrRnE9ZGk5QSU2S8JlP6kvopbjGbAMniG91S/OI82wqj+fSUxUP7hGQeYfYjsoV1TJH2AUQ1izDXMz9sHxfHS1/HHJ61Mgsf4MUsudPA5RYP3yElKRO9o5CaFHQ8bJcrfVXuZs00KbC2pUYi3ZE9hJnHPIVxh3WuAtOlE0++arOQQG4pCYWlGGlwJM6DJhWahurBtCFgUv76HquH54g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 69.169.224.1) smtp.rcpttodomain=virtuozzo.com smtp.mailfrom=eu-central-1.amazonses.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=sashiko.virtuozzo.com; dkim=pass (signature was verified) header.d=sashiko.virtuozzo.com; dkim=pass (signature was verified) header.d=amazonses.com; 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=Is+frNRDgaAlrvmh89Pa1Ky7zCnnbnPwsGp0zLQeWtE=; b=XKJfS+CwaiIZsyrSkj9Rbs8XWjSseahOTRfv/7UYYGMAdpoCE+oUCSZeA4tFTK0gWc17RdEd9NGV3c64gyI/UBwPfgJtjJyzd+OEKrdyxzyXyixd1ms7SSzVhMJ9tMgNNvzB+s4xd/Yu0hw5TDcV4dEp625JYHZVLiuh6XzTNqA= Received: from AS4P195CA0002.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:5e2::6) by ZR6PR08MB428560.eurprd08.prod.outlook.com (2603:10a6:910:dd::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.12; Tue, 1 Dec 2026 01:07:14 +0000 Received: from ZR1PEPF0000E45E.eurprd04.prod.outlook.com (2603:10a6:20b:5e2:cafe::5a) by AS4P195CA0002.outlook.office365.com (2603:10a6:20b:5e2::6) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.662.13 via Frontend Transport; Tue, 1 Dec 2026 01:07:14 +0000 Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 69.169.224.1) smtp.mailfrom=eu-central-1.amazonses.com; dkim=pass (signature was verified) header.d=sashiko.virtuozzo.com;dkim=pass (signature was verified) header.d=amazonses.com;dmarc=pass action=none header.from=sashiko.virtuozzo.com; Received-SPF: Pass (protection.outlook.com: domain of eu-central-1.amazonses.com designates 69.169.224.1 as permitted sender) receiver=protection.outlook.com; client-ip=69.169.224.1; helo=b224-1.smtp-out.eu-central-1.amazonses.com; pr=C Received: from b224-1.smtp-out.eu-central-1.amazonses.com (69.169.224.1) by ZR1PEPF0000E45E.mail.protection.outlook.com (10.167.241.54) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Tue, 1 Dec 2026 01:07:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=23yjbh4k34hwzfubhuiim7m4inbd3ick; d=sashiko.virtuozzo.com; t=1796087233; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=R/6udKU99IgN5uFVQio9dnsB3Jx6L8q3jCMZvMupOVM=; b=JPuReJJBJbejsgnOuwKvySVIyuNz/9E9NaLvSqUXm2VEkGVphO4JGcog0+BDvxkG RcJrf4jYoDnCdHmlOsChor0lTpN1GjalEMi6s08EKaEZfAHSXRZygaO1e0xa+Z6DWw2 xAkztlYCdni+a/9Gwsn89Cxs1dvDo8fSgGg7XWaYws3Ki30mAPEAHX+MHRY0u2rux0D vax2u4uvwgY3FlesSVE0YN3htltZT6/bIly6cLTuX+OnPSMctOUA9+7fz6JNd/7oq+d oZw2Qnv1FGn7qsuClNE86zdj4jAoDnbG6JlhAZ37CM0QsJPn2kLzQ+VwU3NMYaTBPBN qI+sgFfR6w== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=qftdzk2dqsatjnlrq4r5brjbihpfcrsh; d=amazonses.com; t=1796087233; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date:Feedback-ID; bh=R/6udKU99IgN5uFVQio9dnsB3Jx6L8q3jCMZvMupOVM=; b=fFD8r2l/p8cs6St6hZRXVZPRpO9MrHB1qr+afgzPBNR+3B3hFbK4g+Dz9ENC04IF 3O99EEKBu45kKHin4667B/5QpTjQtB5b9Nl/Ef9KEor8tAnXUpE32F6j2g07MHU7UBy pOsoRYK3HYcGpqusn9axTRUSo2iPdIXXLbSZPUzA= Message-ID: <010701a22f243cea-a121e4cd-5006-4088-ba16-6140a4dd09f4-000000@eu-central-1.amazonses.com> From: no-reply@sashiko.virtuozzo.com Subject: Re: [PATCH hci-8.2 v3 4/5] vhost-blk: pause the VM on a request failed with ENOSPC #VSTOR-152175 To: Alexander Ivanov , andrey.zhadchenko@virtuozzo.com Cc: andrey.drobyshev@virtuozzo.com, svt-core@virtuozzo.com In-Reply-To: <20261130094210.1686802-5-alexander.ivanov@virtuozzo.com> References: <20261130094210.1686802-1-alexander.ivanov@virtuozzo.com> <20261130094210.1686802-5-alexander.ivanov@virtuozzo.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 1 Dec 2026 01:07:13 +0000 Feedback-ID: ::1.eu-central-1.2wRQJBpg9g1fGRYexx3dUuYGS25Bux+2TEOx72/m6U4=:AmazonSES X-SES-Outgoing: 2026.12.01-69.169.224.1 X-EOPAttributedMessage: 0 X-EOPTenantAttributedMessage: 0bc7f26d-0264-416e-a6fc-8352af79c58f:0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: ZR1PEPF0000E45E:EE_|ZR6PR08MB428560:EE_ MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 55c5a4bc-7f46-4ed8-bf3f-08df4f476f8e X-LD-Processed: 0bc7f26d-0264-416e-a6fc-8352af79c58f,ExtAddr X-MS-Exchange-AtpMessageProperties: SA List-Id: svt-core@virtuozzo.com X-MS-Exchange-Transport-Rules-Loop: 1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|704160311799003|61400799027|32142699015|48200799018|376014|9140799003|55112099003|10067099003|56012099006|5063699009|5023799004|261022105027099003|261026140227099003|261021121427099003|261028144727099003|261026121527099003|261102123227099003|261009223027099003|22082099003|18002099003|16102099003|4143699003|5113699003|4113699003|13003099007; X-Microsoft-Antispam-Message-Info: C1uxoxKCXZNxH429PDUg6WCaqbY5Gg0E1w2OX2O7B37OwikoEucdYQwvlMjhTJSE1YOGP8lEbdRap1EY9ozMQ6hLKHCiscF8B8tLfZu8XOh2nJOhSJlTvW5eeHX5UgNNZVdvXJm9nggthhstCLVnncTdEoR4tqgb1Fa5GnklLW6hofnt34ow8Um2U9hQvRh7WImdp2Gw/9iM9oPUuD1RzMb94prXXEC59owXGsLdJ+q8oHxoR4CVjOTKfV7bbAtRa8XkNoM46AhEH496xCmSs6QViqnKEKWrK+Yc39bELC3JmSK6FcLqM17HqsxturLeWWu3N2vtQ5b62j1lds01bxsm2fao8svqbuD5qVMf0x7X/Xm5X5l32ixlhcZQQTVEMrakqBAFHtKx3OXMJ7b2uJ0cUl3qtyBvNW5yldF4JB33Oqt4j2RnNAy18+V2N+lSUE1Y2EW+4vwR2c9+688J2c6ba9FHHaSSDzoGcHBl4/pnbcPI1lE79vLDaz2u+Py/0Oz9DjgO5ZqpH6h1ty9Cj+a7pbI/3X3Xd2KN7fQjSTzpzH4QFBGx0jxNCPApLB1Mv3ivjY3Gap+e6++BJULtMPGfsmGBv7HccoSW3vulB4G6XHlM+fw6ESOAgz8e9W5Hp+sXzaNBfDk0VRxciAwN4yDZTUHtXOqLUW4WSKFkIenxSxRTnp4PV1ZOnMgNk+RxR312cwQwYMJ21yck4KRZzYzlupFRDLehys0q9i13o0SpKsVw3ej9xSXa30TeGg3NajY0W+YPDzbsjDiN1rnTn9FVazOoqZyusj/zYZCN+FKrQ+GNK3BRSOtGG04v5zs+N5HqASmanhC5dF2t+cYBN1k78A7wZYrFErLkvsl1inzLCXquRzIDyGh3tzCTMvnmbiS7NrkYRukqI702sKcMIg== X-Forefront-Antispam-Report: CIP:69.169.224.1;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:b224-1.smtp-out.eu-central-1.amazonses.com;PTR:b224-1.smtp-out.eu-central-1.amazonses.com;CAT:NONE;SFS:(13230040)(704160311799003)(61400799027)(32142699015)(48200799018)(376014)(9140799003)(55112099003)(10067099003)(56012099006)(5063699009)(5023799004)(261022105027099003)(261026140227099003)(261021121427099003)(261028144727099003)(261026121527099003)(261102123227099003)(261009223027099003)(22082099003)(18002099003)(16102099003)(4143699003)(5113699003)(4113699003)(13003099007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nMdNlU52XsVDb88aSd639R7RB+OWIRIjqRG7E9tCkEzCOe4oT9jYbuvS4tY5ciDENXZg4OC4hXMKnTk9LXBxSn64YA6/iYKU58NincYuhTXMCV8D0SeyX/2ZDQdillsRa15m+Vb3ZXcD8bmMYK4wsEsem2M1ckKfQuSQHISrOyo2xiX6vFNfhuP55qLALB4YfGKm+n1aeKYSM1Uqz1VfQj1iI9kn4flvVq0dbwH0EeRmun5aRF121aPtMx0JAzVjRSTkwAB0nUaq7l29EVvYS1RKpnLQlsmQpLwv77n2ImIwZtKsOqDv2R2WuZNP7ETzQ3nJ4qMaVmTh+6/O5To0D/ccv6P5HrHSo4B3Mrb0+mAVIxu0jvUhylg1bKqEOOcaNpMQfcfZOdgaABYCFaHmd+al1x2v3uUNu/m/H1Xb1o8JP/f3/VWrvVEIdUZM+3QJ X-ExternalRecipientOutboundConnectors: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 01:07:14.1793 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 55c5a4bc-7f46-4ed8-bf3f-08df4f476f8e X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: ZR1PEPF0000E45E.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZR6PR08MB428560 Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Medium] vhost-blk: vhost_blk_resubmit_held() retries ENOMEM forever without progress - [Medium] vhost-blk: vhost_blk_save_held() drops held requests when GET_HELD_REQS fails - [Low] vhost-blk: vhost_blk_resubmit_held() drops a head on resubmit error -- commit 81d26424eb761f296b39790b51894a86c271e60a Author: Alexander Ivanov vhost-blk: pause the VM on a request failed with ENOSPC vhost-blk completes requests in the kernel, so werror and rerror have no ef= fect. This commit sets a hold policy in the kernel from werror and rerror, = and passes an eventfd that is signalled on a held request. QEMU then stops = the VM with the io-error reason, saves the held requests when vhost stops, = and resubmits them on the next start. > diff --git a/hw/block/vhost-blk.c b/hw/block/vhost-blk.c > index 124885a2b3005..19003def39335 100644 > --- a/hw/block/vhost-blk.c > +++ b/hw/block/vhost-blk.c [ ... ] > +static void vhost_blk_save_held(VHostBlk *s) > +{ > + g_autofree struct vhost_blk_held_reqs *reqs =3D vhost_blk_get_held(s= ); > + int i; > + > + g_free(s->held); > + s->held =3D NULL; > + s->nr_held =3D reqs ? reqs->nr : 0; [Severity: Medium] Does this lose held requests when VHOST_BLK_GET_HELD_REQS fails? vhost_blk_get_held() returns NULL on any ioctl failure, and this line treats that the same as an empty list. The held heads are already consumed from the avail ring, and the kernel list is dropped by the following VHOST_RESET_OWNER or the next SET_BACKEND. Nothing is saved on the QEMU side, so these requests are never resubmitted or completed, and the guest hangs on those descriptors. Before this patch such requests were completed with an error. Should the failure be distinguished from an empty list? [ ... ] > +static void vhost_blk_resubmit_held(VHostBlk *s) > +{ [ ... ] > + if (!ioctl(s->vhostfd, VHOST_BLK_RESUBMIT, reqs)) { > + break; > + } > + if (reqs->nr >=3D nr) { > + error_report("vhost-blk: unable to resubmit held requests: %= s", > + strerror(errno)); > + break; > + } > + > + done +=3D reqs->nr; > + if (errno =3D=3D ENOMEM) { > + continue; > + } [Severity: Medium] Can this loop spin forever? If VHOST_BLK_RESUBMIT keeps failing with ENOMEM and reports reqs->nr =3D=3D 0, then "reqs->nr >=3D nr" is false, "done +=3D reqs->nr" adds nothing, and "continue" reissues the identical request. This runs from vhost_blk_start() on the main loop thread with the BQL held (vm-state handler or set_status on DRIVER_OK), so the whole VM and QMP would hang under host memory pressure. Would a no-progress check or a retry bound help here? > + error_report("vhost-blk: unable to resubmit held request " > + "vq %u head %u: %s", s->held[done].vq, > + s->held[done].head, strerror(errno)); > + done++; > + } > + > + g_free(s->held); > + s->held =3D NULL; > + s->nr_held =3D 0; [Severity: Low] Is the guest request for a skipped head ever completed? When VHOST_BLK_RESUBMIT fails for one head with an error other than ENOMEM, the head is logged and skipped with done++, and s->held is freed after the loop. The linux-headers comment for VHOST_BLK_RESUBMIT says the kernel does not track heads once they have been read out, so no later start can retry this one. That guest I/O stays outstanding until the guest times out or resets the device. --=20 Sashiko AI review =C2=B7 https://sashiko.vzint.dev/#/patchset/2026113009421= 0.1686802-1-alexander.ivanov@virtuozzo.com?part=3D4