From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from AM0PR02CU008.outbound.protection.outlook.com (mail-westeuropeazon11023137.outbound.protection.outlook.com [52.101.72.137]) by lore.virtuozzo.com (Postfix) with ESMTPS id EDA8D80063 for ; Tue, 1 Dec 2026 09:25:32 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PuOcL9g10rad4cowOTtTqTw2ZML+NBhTmAVZkPDTxKmf1zAh2TJasKQD3GXiP0sRiyL7jOdt2dopypQN5bsquuAu3NYuN339rFsy2mpZKahb7o2fpbdkvCx/9A4BlVIB0duWQivey/EI5usTY9SNOqlbkEZD3BQc3vDb01TmF+WKTWQTrX0BZLHLsupTCeE9JoT6E6FsLN/kczsOnhbu5j5WWbd3aP05RUsKSeAw8hU+vW6XjjciSpho8pzRr3aIY+T5onrDizByhy237gExbkzYxItsBn+q0Yw4sc8Wujj5G+lTPZW8IFhbKnxYv5vIBOFMY5jPHR4le4e4lqA6IQ== 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=O16R7CjkmxfsHN8GE19mkuACVMucHH3GT8K0wRH4LIM=; b=BMUHuB3agZ0EY9bnzJw9tc67YtWRnuxGzsuYV342N5fQvWuucYkhHoH4CrkALpurXRthu2VdvXJKMROc5tvZxPL7eGBp1bdxhnoNIIdtxBS5Tc1zfqS4EQfJDnaxBgxC5rloy0ykV4rrPoYQbfcijN86zc8oOtPfdnEhelOjrfwoVDnO4VswCMJGK5SP995S3N7PiQIaByx1n48bf//MU624WifJSh3QhOnJGgJgh8JcLaUQU5kiXYqWHvo0u74dx2iwPQj9b3FIn+jt//pqXM3Jj0MJfVJjrARorTqHdNl28rTPN3eqcXL/OyexbQfcLQ1R9MmkeACbvyZcKCs7Vg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 69.169.224.5) 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=O16R7CjkmxfsHN8GE19mkuACVMucHH3GT8K0wRH4LIM=; b=SHmYlq5pkPzhm1aR6q0sZByJYkKoVkB4qAbim9xS5CkTE3wH5nCIXpoB7E6w1GJgrWZNRUSnI0eSib86nfwFxm4NAi7+TevrZATi0VXsD8eK4p7Fiw/5cmHkiOTFUGtM/86qt0Qt4gBotI3z3cOg3XDybl0sLxMMe6duYEPrfP8= Received: from DU2P251CA0027.EURP251.PROD.OUTLOOK.COM (2603:10a6:10:230::33) by AM8PR08MB6530.eurprd08.prod.outlook.com (2603:10a6:20b:315::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.13; Tue, 1 Dec 2026 09:25:31 +0000 Received: from DB1PEPF000509F8.eurprd02.prod.outlook.com (2603:10a6:10:230:cafe::2a) by DU2P251CA0027.outlook.office365.com (2603:10a6:10:230::33) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.10 via Frontend Transport; Tue, 1 Dec 2026 09:25:31 +0000 Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 69.169.224.5) 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.5 as permitted sender) receiver=protection.outlook.com; client-ip=69.169.224.5; helo=b224-5.smtp-out.eu-central-1.amazonses.com; pr=C Received: from b224-5.smtp-out.eu-central-1.amazonses.com (69.169.224.5) by DB1PEPF000509F8.mail.protection.outlook.com (10.167.242.154) 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 09:25:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=23yjbh4k34hwzfubhuiim7m4inbd3ick; d=sashiko.virtuozzo.com; t=1796117130; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=zLsfIg2jXlutR+1RrsCu4ZlqZxYU8D8SIXnfWVpj4Fc=; b=EBDPaRynz2dDTbLCSNsIQaxYb7ZVZ7AO2esTmYhRY8Wxxke6eVR3gQ+P2il3aQ7W FDlCFTasKE15mV4WYLEM5ex7o/vkVCvNWDm6Ya4Zoc6XdzsH8IvvqUUJ1CoM2rYpdFU YM8t//Jj1wvs77f6p17XS7wpjarSqnZAgWl28KRpYmlV4e2tjirBospbZg2lIMP7qrU zLB02HU5F35UDuxApMoQ3bBEn6YvxLkVhKlQkyHFvllJBGoOQ/wiWkPUGZFx8PAsHMx j2t/vYbW2eoELao8ci8j9nKFuBGeDUdQ/n53C8yC4S5f7b7XlVsVzLtB4gfq3xD9JzJ V8fqdhge6Q== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=qftdzk2dqsatjnlrq4r5brjbihpfcrsh; d=amazonses.com; t=1796117130; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date:Feedback-ID; bh=zLsfIg2jXlutR+1RrsCu4ZlqZxYU8D8SIXnfWVpj4Fc=; b=bNrhtD155Y/BAIfEpLX8NsoqbvjpdrZJu7fgVytiekyhAt3k09xq9rvhMnv6hLQs liIIVou6+uxKfdNVqyyolPJaUxTlF2iPeGZxQKiLcWM8riLnJ2uNTvM5qlWo/M9Jv9e dLLzCL5Qs2L8bblTixIi1E18p5JoeSxA66F/wXkc= Message-ID: <010701a230ec6ca1-1f6f7a3e-f1ab-4f71-9cf2-747f0a0f3535-000000@eu-central-1.amazonses.com> From: no-reply@sashiko.virtuozzo.com Subject: Re: [PATCH hci-8.2 v4 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: <20261201091818.1894308-5-alexander.ivanov@virtuozzo.com> References: <20261201091818.1894308-1-alexander.ivanov@virtuozzo.com> <20261201091818.1894308-5-alexander.ivanov@virtuozzo.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 1 Dec 2026 09:25:30 +0000 Feedback-ID: ::1.eu-central-1.2wRQJBpg9g1fGRYexx3dUuYGS25Bux+2TEOx72/m6U4=:AmazonSES X-SES-Outgoing: 2026.12.01-69.169.224.5 X-EOPAttributedMessage: 0 X-EOPTenantAttributedMessage: 0bc7f26d-0264-416e-a6fc-8352af79c58f:0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB1PEPF000509F8:EE_|AM8PR08MB6530:EE_ MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 8730989d-8723-4e83-f84a-08df4f8d0b60 X-LD-Processed: 0bc7f26d-0264-416e-a6fc-8352af79c58f,ExtAddr X-MS-Exchange-AtpMessageProperties: SA List-Id: svt-core@virtuozzo.com X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|704160311799003|9140799003|61400799027|32142699015|48200799018|376014|55112099003|5063699009|10067099003|56012099006|261026121527099003|261028144727099003|261022105027099003|261021135927099003|261021121427099003|261102123227099003|261026140227099003|261009223027099003|4113699003|5113699003|22082099003|16102099003|18002099003|4143699003|6133799003; X-Microsoft-Antispam-Message-Info: ZQibsWuvcMNLXAcXLRXolwJ0SRVmTskV/fDpE+wmBxmSwCcjOKMvZu9E8vMPKJYCyfZFz5DeHoWzGKzY6AvS3w/QyBEVvReGGj7rLlmirXGcqalIGtR5MIVfKeWoMnFsO0r/bAaXIvGglwvNEFTQaJAOycwAEi0RLRxn3/Sbxj/LctLGGOBYEIhwf6nC5C24568zjIY0Mm1c7bMmj6YzxFN8hVhIiz7YbcBdcebh8w5zxOLjMV6T4eH53MsG/LQ9q7mGUh5E9m5Bhoe+fEjqvTaVYrE2vsCe1JZby+UJ1zTB6CFVPpzmb01ieQ9zwRrLDxAdh5n1LQFV4E9jQIBDIZQ/+y5L5ZV0A/AzmSwGdZEaZYOLY21B/Vx6eTFDYGn2zqHhT96nezpWeCZqBflK/QVXJVlI7J12wgf9gejvBVfrM0TkBD0SPHLYlrpF1JbOjE2dRpi2Xe9Dlk+5KOTO6WKlJSAMU9kl18CMdOxOfpM65us1jFiY2RS9JR3G+h82HAI68wYxAvQ4QLHmkhTQBIkH8DCX7SLU888JRD7zV6keiZxTOdNrEsKCRScpxvUwhCl0/jEvAYhoq0lLJGZrpKJW/t9DuwNEeo6PE2IHfvlNQONNXcKyjVZMMgre3HnaJyoehfF0NQt6yHlUMHyLy/ydmB5KZcOK5jhGfSuuoGA8SxrFbiAnZ7gqG5iP+4VYDqAWU3qMhTn/Ftd8X5H+rF4aoxWxDKvESz0XNfU04DpB9ssDdX4jQWeTlgFEUMa4I2jqtyaLvBxq20Qg0ZHiMyZytWCZJoVtruJjCho2mavdXHozSHA4nodfpbV4b7mn49HNhtaNK4OozG1ObsU1UzxFyITK7RS3xy00hXZ76U0DoufTIDpajiyJYVWbaJ6zuPKIbojNh6ZHkJAR5dgNOQ== X-Forefront-Antispam-Report: CIP:69.169.224.5;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:b224-5.smtp-out.eu-central-1.amazonses.com;PTR:b224-5.smtp-out.eu-central-1.amazonses.com;CAT:NONE;SFS:(13230040)(704160311799003)(9140799003)(61400799027)(32142699015)(48200799018)(376014)(55112099003)(5063699009)(10067099003)(56012099006)(261026121527099003)(261028144727099003)(261022105027099003)(261021135927099003)(261021121427099003)(261102123227099003)(261026140227099003)(261009223027099003)(4113699003)(5113699003)(22082099003)(16102099003)(18002099003)(4143699003)(6133799003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OSpiU+FQuJbf7vcIZb33QenWYwNcZOmmL+7PCfP7Fhlg4/ODJPPCCTNHLZj1Gsh4pUsKio3QugC57WQF5mWvd/ic71ciGBALpDz5OlWNZIebHFBQDZcYSJ0ARuXzenlJLQUkHVDat/g5o72HCjW1V7FpUVK4VX85I+ZqlqsnMnu7cQw+5SZcIaCJxu75IrHdejls4HnfR8HiL/Te5duCQ0Kueh3mkXOyAhNvc87t4UucpitzbGU65PtzGv86UCduSxqASIMECN3ZCNhtq4wmp9ot9z1C4JIQ4AmYjhZQzhyJf23Ndb1KK1nPOwdcpjVEbMnMue7OMwt1MNPGVCpzfJvncJTRnNmgXC3WuT4K4rsaYEuiuoejbfO2YJXp+tte6jBdqGIMripvo9kblBhFRnNiVDWi62rPrIuefB31PQ+Am3J6b1VRTrnj0M9NDHGX X-ExternalRecipientOutboundConnectors: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-Auto-Response-Suppress: DR, OOF, AutoReply X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 09:25:30.8886 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8730989d-8723-4e83-f84a-08df4f8d0b60 X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: DB1PEPF000509F8.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6530 Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Medium] vhost-blk: vhost_blk_resubmit_held() retries ENOMEM with no progress check or bound - [Low] vhost-blk: BLOCK_IO_ERROR reports wrong op type and fake offset/bytes - [Low] vhost-blk: realize warns about unsupported hold even with default werror -- commit b49f3db331e7b9faf3866f19bf4738d66fb75fb6 Author: Alexander Ivanov vhost-blk: pause the VM on a request failed with ENOSPC This commit makes vhost-blk set a hold policy in the kernel from werror and= rerror. The kernel then holds requests that fail with ENOSPC instead of co= mpleting them with an error. QEMU stops the VM and emits BLOCK_IO_ERROR whe= n a request is held, saves the held list on stop, and resubmits it on the n= ext start. > diff --git a/hw/block/vhost-blk.c b/hw/block/vhost-blk.c > --- a/hw/block/vhost-blk.c > +++ b/hw/block/vhost-blk.c > @@ -32,6 +32,102 @@ [ ... ] > + while (done < s->nr_held) { > + nr =3D s->nr_held - done; > + reqs->nr =3D nr; > + for (i =3D 0; i < nr; i++) { > + reqs->reqs[i].vq =3D s->held[done + i].vq; > + reqs->reqs[i].head =3D s->held[done + i].head; > + } > + > + 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 done does not advance and the identica= l ioctl is reissued. There is no retry limit, backoff or zero-progress chec= k. vhost_blk_resubmit_held() runs from vhost_blk_start() with the BQL held, so= the whole VM and QMP would hang under persistent host memory pressure. Sho= uld the ENOMEM retry give up, or back off, when reqs->nr is 0? [ ... ] > @@ -274,6 +397,38 @@ static void vhost_blk_vm_state(void *opaque, bool ru= nning, RunState state) [ ... ] > + req =3D &reqs->reqs[reqs->nr - 1]; > + path =3D object_get_canonical_path(OBJECT(dev)); > + > + qemu_system_vmstop_request_prepare(); > + qapi_event_send_block_io_error(path, proxy->id ?: "", NULL, > + req->type =3D=3D VIRTIO_BLK_T_IN ? > + IO_OPERATION_TYPE_READ : > + IO_OPERATION_TYPE_WRITE, > + BLOCK_ERROR_ACTION_STOP, true, > + req->error =3D=3D ENOSPC, strerror(re= q->error), > + 0, 0); [Severity: Low] Is the event content accurate here? Any held request whose type is not VIRT= IO_BLK_T_IN, such as flush, discard or write-zeroes, is reported as a WRITE= . The offset and bytes are always 0, 0. The commit message says the event i= s emitted "as the block layer does for other devices", but management softw= are gets inaccurate operation, offset and bytes fields. [ ... ] > @@ -815,6 +978,14 @@ static void vhost_blk_device_realize(DeviceState *de= v, Error **errp) [ ... ] > + event_notifier_set_handler(&s->error_notifier, vhost_blk_error_event= ); > + s->hold_supported =3D !ioctl(s->vhostfd, VHOST_BLK_SET_ERROR_POLICY, > + &policy); > + if (!s->hold_supported && vhost_blk_error_policy(s)) { > + warn_report("vhost-blk: the kernel cannot hold failed requests, " > + "werror and rerror have no effect"); > + } [Severity: Low] Will this warning fire for every device on an older kernel? Realize maps we= rror=3DAUTO to BLOCKDEV_ON_ERROR_ENOSPC, so vhost_blk_error_policy() is non= -zero even when the user never set werror or rerror. The result is log nois= e on every vhost-blk device, while the commit message only says "warn and r= un as before". --=20 Sashiko AI review =C2=B7 https://sashiko.vzint.dev/#/patchset/2026120109181= 8.1894308-1-alexander.ivanov@virtuozzo.com?part=3D4