From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id E62DA803BB for ; Tue, 17 Nov 2026 10:44:53 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AHAhYna008330; Tue, 17 Nov 2026 13:43:35 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AHAhYna008330 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="G5ObedEO" Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AHAhW0p008296 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 17 Nov 2026 13:43:32 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AHAhW0p008296 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-48e00f3929bso444171f8f.0 for ; Tue, 17 Nov 2026 02:43:32 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErG0qrwaFvvNo/5lpIm6H2Q+Jswntn7gILsWjk1+vRdRISmTROUNiSEQVgIm/TWFc+q4YttodA==@openvz.org X-Gm-Message-State: APuU4Z9MjRlFgmSDlN2geLQeadaXzrncEF6xwVT3W+2d2HlD7wXS3dHQ dEJukVgC8XRfSemDWWPNpwMiEWsBMEpvypWJdeY0bRWdHP8Xucv1WLSFRbPFZK1rac7yDwr6ISl wS0XYawdBKmqNl2eGC+CZb6evgHxQ46QrjTFllZjcxuV3ipiIOVfneQ== X-Gm-Gg: AYBFou0Kmskr0SVo3ZywH/+TmBJsXs9rnAWoLZswEE3U5vwa6CLPo9BVQnJVivXOsOi 1LbNsd2/kEqkNuwhiB9k6QO+phaKyMxUdIiqrFmXDyOqw+JjvnmnI/ruHDGLMryhgnZqf95P1/Q frE3wwPMypsfQo/19BI3q/Wf3zUF/tfy628Or7Yhz1eY+ys19tQSrLjBpS4ruF2uVqJ1kmQ1yEe 4Wt2TiSe2I/FT42vsQkPT6J80JsOft8wA7GnnS61NScTGrdohxSJgZ0tqFXvVV0QG8lXOCKRKA5 QFTfOgM4doRhi0LcUn2KW9aypvuUx7ov+3m3wr17UofY+C08qCjmrP7nkduX+9N5bhQU5i5kQnN 6qFv3anaWu/leafJychSSRBgjA1Wm X-Received: by 2002:a05:600c:3ac6:b0:4ba:7a0:7b67 with SMTP id 5b1f17b1804b1-4bb783aeb29mr51096655e9.3.1794912212161; Tue, 17 Nov 2026 02:43:32 -0800 (PST) X-Received: by 2002:a05:600c:3ac6:b0:4ba:7a0:7b67 with SMTP id 5b1f17b1804b1-4bb783aeb29mr51096245e9.3.1794912211619; Tue, 17 Nov 2026 02:43:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794912211; cv=none; d=google.com; s=arc-20260327; b=bn6lPE/755Axm9S9TjThKhyg6JWxkeKHaltjVkRRUJE3U+93p1nkvKuReT3aVUjqJd 8Dv48Gwrm2gLwNbgmUKVkWyNQ09+eRv1xz22WMk6P467uXxX2hra7jH6IOvT1HjKxUhd T1Y07he26MNdoElBCHUeum3Yl0sK+3+Hz9sDT69YfRMlavTh3THGYTO/mX3Qv3HzoR9a EDKAIcGJaz7FM44yrQTbhbU6bSIog7e6UuFsv4OfjHEutOfrmKQXisTql86FXTr/+Eyh XgaAmsvuqXGjFF1yz5dLDAwygULdlQQE8g9BfpvSDIWokp/F8UhybIOxWuAdX8SU3uFG VuQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=xOEXkT9kZlcJDT76DtT3EcjT3LkyCK8AtqpDZDZwspo=; fh=CMILZ+goaghq6B4UpCDhf0EQp6kYD0LAlmOkUiVCOvs=; b=HIHIvsuHrdAdTu3pb6VysvnsbmGfeMxGC4C2xVXN/GPRFIzH2w7Cn3nbZzQYjdDzUG XcM8AHVV+DPWwHk3UyG0uZ9iZjePA+pec69GkvU17FaGl+k1SDTNCkx6GZa6jmYZ0d/a 8la3xYAHkS+xAaA/2bC7mN7AoE9HCMXnabvoOBjA6zn/PoJOaHlxB7VFV/C4dd86KtSo bBmY63XPX6GDTS4DGK4Fca+jB0w9yAaMDxG1Qr+sf2G6fk5w6Q6RzyaoREsh4FzBIwP3 z+u6LY3LvAgEGYP6MZelSlBD+t0ekpvKkMlH6CNrFvvn+T6/0kok1SyuHlkGUpxQ7QNv NWrw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=G5ObedEO; spf=pass (google.com: domain of alexander.ivanov@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=alexander.ivanov@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-49c636ee282si26664984f8f.167.2026.11.17.02.43.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2026 02:43:31 -0800 (PST) Received-SPF: pass (google.com: domain of alexander.ivanov@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=G5ObedEO; spf=pass (google.com: domain of alexander.ivanov@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=alexander.ivanov@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=xOEXkT9kZlcJDT76DtT3EcjT3LkyCK8AtqpDZDZwspo=; b=G5ObedEO2j+E GSyEUdReKT6tCOVX++HNqYAwk5Me8M1IY5ZnSMlk4G0PPeiP37jBLX72imjGb0+iZLKC4XWbx6l8U jzucmDzRXBEVynEQUqME6Vb+VVAG4U/XHKt3020g9QT5LpaKep/iXVxQUYSN5Dg4URJyyPjL5eUUU UtRJGFqusGXBXDLv559g4hUyIIoXuQ61PI/1VVsJJKGYk80gp94gq7FFuFKOi1dTi6kueU7FR7cBX EAaTR7ZTiwAAeveWwn0o75jWYij9F0v2npSmNecdxuzm98znGKT8CKIyM6y6b75Ytlg2MfcOe4jLa uyYIcE0CVLJ1xKIh9DO3Tw==; Received: from ch-vpn.virtuozzo.com ([130.117.225.6] helo=sky) by relay.virtuozzo.com with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xTGag-009vj8-2Z; Tue, 17 Nov 2026 11:43:21 +0100 From: Alexander Ivanov To: andrey.zhadchenko@virtuozzo.com Date: Tue, 17 Nov 2026 11:43:20 +0100 Message-ID: <20261117104329.3079812-1-alexander.ivanov@virtuozzo.com> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v3 0/9] dm-qcow2: support the werror/rerror policies for vhost-blk disks X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org QEMU disks have the werror/rerror policies: on an I/O error either report it to the guest, or pause the VM and retry the request on resume. A vhost-blk disk completes requests to the guest from the kernel, so QEMU never sees the error. This series lets dm-qcow2 hold a failed request according to the policy, tell QEMU about it, and retry or fail it on request from userspace. Patches 1-2 fix the existing ENOSPC delay: a use-after-free of the event work and timer on destroy, and a suspend stalled by a request delayed while the timer callback runs. Patches 3-4 rename the ENOSPC delay list to a held request list and arm the retry timer once per hold, so new failures do not postpone the retry of the held requests forever. Patch 5 sends an IO_ERROR change uevent when requests get held, as QEMU cannot wait for dm events without CAP_SYS_ADMIN. Patch 6 adds the resubmit and fail_held messages, so libvirt can retry the held requests on VM resume and drop them on VM destroy. Patch 7 adds the error_policy=, table argument with the report, enospc and stop policies. The default keeps the current behaviour for writes. Patch 8 requeues held requests to the dm queue on a noflush suspend, so a table reload or a snapshot of a VM paused on an I/O error does not deliver the error to the guest. ploop suspends with flush for a snapshot and a resize, so this needs the ploop.ovz change below. Patch 9 fixes a vhost-blk hang on release when the vhost worker was killed with I/O in flight, which a VM destroyed while its requests are held runs into. How the VM is paused: QEMU stops the VM with RUN_STATE_IO_ERROR on the uevent. vhost-blk keeps running in that state, so the held requests survive the pause and libvirt resubmits them before cont. Any other pause stops vhost-blk, which waits for all in-flight requests with the BQL held. So libvirt sends fail_held before virsh suspend, save, snapshot and a migration of a running VM, and the guest gets EIO for the requests held at that moment. vhost-blk cannot keep them across a stop the way QEMU keeps its retry list. QEMU blocks migration and savevm while the VM is paused on a held request. Userspace series, all for VSTOR-152175: qemu.vzs, "[PATCH hci-8.1 0/2] vhost-blk: support the werror/rerror policies": vhost-blk: add the werror and rerror properties vhost-blk: pause the VM on an IO_ERROR uevent from dm-qcow2 libvirt.ovz: qemu: pass the error policy of vhost-blk disks to dm-qcow2 qemu: resubmit held vhost-blk requests before resuming the VM qemu: fail held vhost-blk requests before killing QEMU qemu: pass IO_ERROR uevents to vhost-blk conf: allow error_policy for vhostblk disks qemu: fail held vhost-blk requests before pausing the VM qemu: fail held vhost-blk requests before migrating a running VM ploop.ovz: lib: add read/write error policies for dm-qcow2 devices (passes error_policy on mount and keeps the policy of the loaded table on every reload, snapshot, merge and replace included) lib: add ploop_resubmit_held() and ploop_fail_held() ploop: add the -e error policy option to ploop mount lib: suspend unpartitioned dm-qcow2 devices with noflush and tests for both v3: - cover letter: describe how userspace pauses a VM with held requests, list the qemu.vzs, libvirt.ovz and ploop.ovz changes the series needs, note the ploop dependency of patch 8 v2: - patches 1, 2, 4, 9: add Fixes tags - patch 5: state that held ENOSPC reads are reported too, and that every dm-qcow2 device whose storage stays full now gets a uevent on each retry - patch 7: drop the misleading "whatever the error" from the message - patch 8: note that ploop needs the ploop.ovz change "lib: suspend unpartitioned dm-qcow2 devices with noflush" to get the requeue on a snapshot or resize https://virtuozzo.atlassian.net/browse/VSTOR-152175 Alexander Ivanov (9): drivers/md/dm-qcow2: cancel the event work and ENOSPC timer in the destructor drivers/md/dm-qcow2: always resubmit delayed ENOSPC requests in presuspend drivers/md/dm-qcow2: rename the ENOSPC delay list to a held request list drivers/md/dm-qcow2: arm the hold timer only for the first held request drivers/md/dm-qcow2: report held requests with an IO_ERROR uevent drivers/md/dm-qcow2: add the resubmit and fail_held messages drivers/md/dm-qcow2: add the error_policy table argument drivers/md/dm-qcow2: requeue held requests on a noflush suspend drivers/vhost/blk: fix a hang on release after the vhost worker is killed drivers/md/dm-push-backup.c | 2 +- drivers/md/dm-qcow2-cmd.c | 32 +++++++++- drivers/md/dm-qcow2-map.c | 110 +++++++++++++++++++++++++++++------ drivers/md/dm-qcow2-target.c | 104 ++++++++++++++++++++++++++++----- drivers/md/dm-qcow2.h | 26 +++++++-- drivers/md/dm-rq.c | 4 +- drivers/md/dm-rq.h | 2 +- drivers/vhost/blk.c | 52 ++++++++++++----- 8 files changed, 274 insertions(+), 58 deletions(-) -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel