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 E075680033 for ; Wed, 25 Nov 2026 11:58:24 +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 6APBvC6X016165; Wed, 25 Nov 2026 14:57:13 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6APBvC6X016165 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="azGYWGpO" Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6APBv78l016135 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Wed, 25 Nov 2026 14:57:07 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6APBv78l016135 Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-6b9095eeb5bso6924114a12.0 for ; Wed, 25 Nov 2026 03:57:07 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErGGSJHOr1Kta1b6mO6AUV+AbXwL9sGk4XPlQPop4VMf3mXlSyu/HYc0z93vzR1BPCOGXl2knQ==@openvz.org X-Gm-Message-State: APuU4Z+hQzbG7cLUMtrL1RDboiKR/EGbN4GAEbvHN6mxOjSBOUkH1kFY wrlZZI+Vb+BhP+vNd2vaJCv3om+ldjS5zjDf9gzks1h6UjEt+yiHw1tmu/MERBDf6bfn8+dRRQW HFpzkl0/+8cB4o2FJPc3lB7Y4ir77Xg5PriizGDGhDgW1uvQTH76BpA== X-Gm-Gg: AZFdTZen52aXBilhs1PsDfhepm1U4///0m9XDBiX4iJRNlNvaf/5zEqM4zVkKOANIUr bLT2BDVv6eLSyjVZISwGnY+uIHwo3ovLPjeuBRwIg/wGN43MU1XJtJ9iy3Ex/QCiHhWIGGhiDdH 2WYK+w08yQwq0ylgyywpcGaw27c7+GYo9ao7I0QBlNvMWi/xiTylPz1VDB2+Fujt9zhQjpboJ/W HP+2fJqhrj0CAKozHL8snCIXH5CxaAkqUBQE7y3gL62ksF21JcPP8aD7EBsfxMaiZWFpfnN/W2b rX0Lhz85N7SZZMoIqebduC07wbPMR7MT096FoXE1Bf9S9JQOWkA3P6u9WVEXa66nid63xgO2f3H vW22hZHoCjZiQpdTB0cVI7xsswK8= X-Received: by 2002:a05:6402:42c4:b0:6ba:1355:1b3c with SMTP id 4fb4d7f45d1cf-6ba37eb19f5mr13297642a12.16.1795607827245; Wed, 25 Nov 2026 03:57:07 -0800 (PST) X-Received: by 2002:a05:6402:42c4:b0:6ba:1355:1b3c with SMTP id 4fb4d7f45d1cf-6ba37eb19f5mr13297634a12.16.1795607826707; Wed, 25 Nov 2026 03:57:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1795607826; cv=none; d=google.com; s=arc-20260327; b=kULyQnEl2Frvyir3KFkfa2aWD1JhZaMq6Rxu/fMZxDTFtHVekod0fFM50W93bDFK+x Sr1No5jqJAyNdxLEpHmLuD4i8PDLSxA9H3+gG4uSBKOEWgYbEr/7ia869JQAMpcc1Y98 duFTezbfz7lR9OUIB1nOeYkdeJHFF0VlQ+UmRiD+iFIAPcWNP6vpJOS47o1RHefrXrjV aWCtZv7djKoqZip4YrkmEiVP2d8sYGyV5HNiAp3yO/ztkN+WtDNM+1kyYDxH3VcJ9ziu 2cRJ+EJ8HZKZsA5+Gxs2dSr3Y9yiNdjaAK/sXoGad6lA/xoJc1RZpGzUNoay83+kfgfo teoA== 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=6bKO3LcF6fKFitls476mgGNWyDStqjoyaiAWVpKBZ6M=; fh=CMILZ+goaghq6B4UpCDhf0EQp6kYD0LAlmOkUiVCOvs=; b=O64vh9oxM3n0lyw1CM1UZ2GX9O4FM/pm51RcOOOzjaiiXVhqAlxd5KUGSsKCVU1Ged Hv7Dq/vIOVCiFwAtdDN461BIz2WXXLib8ywQaHKGFQGeuGwSAV1ABMjeMVYTfjzp1SZj dz2smu1Xn7MXAdV/Z0+MdcTwrxeOwEFZSV0Dvw48ss5svN1zohkD1utf4RSnrD3DDy+Q lIflj9G6o7Gtmr2mflG5f3op2V33ld15DFIlOFbrNzjaX7ZbMRRvjFDZh7zyTxIJkamC 2N7S91H6RsN3Q9pAnfAMrlJWPAomtH35MWlob7E7kOkxmscT2aiZszPlqwZH9IDdZGmm lJHg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=azGYWGpO; 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 4fb4d7f45d1cf-6baeac0eaf4si4684766a12.132.2026.11.25.03.57.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Nov 2026 03:57:06 -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=azGYWGpO; 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=6bKO3LcF6fKFitls476mgGNWyDStqjoyaiAWVpKBZ6M=; b=azGYWGpOnjME TRPkTYu+lccHzhsm8Ivs7ZbVUAWFjUjKBCAHqPHJ/v5KWaZyTOcAmNlhPSP7t04YqLoLjCzfu0Suw Rz2uWtiMcHhprARl+fPTVlzUyVPMVj5iH3TslotfU8Esi0Z8kNBfDUMa5CbLUhWqJw/otdEtUnkBI y2Yyefrbo8BA+7uRhEA5ncYBAhhWlnpqEgdobbJPhLMxP/j+NIBkcUwQwQsoTbRFwqO5AgQi0PUmD 1IaKNx/Ew1I5n9l1g2iEJN6BAludgIoGR6SNmJKlOw8wMRNSPlNB1w8+NLsiR4CbRoehxuWpB76DS xu+pdkzkg7SwtXH6vijtVg==; 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 1xWBcM-008VZ0-3A; Wed, 25 Nov 2026 12:57:05 +0100 From: Alexander Ivanov To: andrey.zhadchenko@virtuozzo.com Date: Wed, 25 Nov 2026 12:56:59 +0100 Message-ID: <20261125115703.741517-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.2 v3 0/4] drivers/vhost/blk: fix write zeroes errors, support VIRTIO_BLK_F_DISCARD 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 vhost-blk does not offer VIRTIO_BLK_F_DISCARD, so a guest on vhost-blk cannot release unused blocks of its disk, while virtio-blk in QEMU can. vhost-blk also fails WRITE ZEROES with VIRTIO_BLK_S_IOERR when the range is above the backend limit, which the guest does not know, and once the backend loses WRITE ZEROES support, e.g. on a dm table reload. In the latter case the guest gets -EIO instead of falling back to writing zeroes itself. Patch 1 drops the ring features that are already part of VHOST_FEATURES. Patch 2 stops checking WRITE ZEROES ranges against the backend limit. Patch 3 answers VIRTIO_BLK_S_UNSUPP to WRITE ZEROES when the backend has no WRITE ZEROES support. Patch 4 handles VIRTIO_BLK_T_DISCARD as a single-segment request sent to the backend as one REQ_OP_DISCARD bio. The QEMU side is sent separately. v3: - merge with "drivers/vhost/blk: return UNSUPP for write zeroes on a backend without it", split into patches 2 and 3 and put before the discard patch, so the WRITE ZEROES fixes apply without it - patch 3: test the op in vhost_blk_req_done() through req->bi_opf; treat any failure as unsupported once the backend limit is 0; say this replaces the contract of 3b2e28a4f6b7 and add its Fixes: line - patch 4: count any discard failure as success once the backend discard limit is 0; pass bdev to vhost_blk_parse_segment() instead of a size limit; complete both request types through vhost_blk_req_submit_or_complete(); say which limits the VMM must set v2: - discard patch: keep vhost_blk_parse_write_zeroes() and add vhost_blk_parse_discard(), both on top of vhost_blk_parse_segment() that reads and checks the segment, instead of one parser full of per-type conditions https://virtuozzo.atlassian.net/browse/VSTOR-141683 https://virtuozzo.atlassian.net/browse/VSTOR-141684 Assisted-by: LLM Alexander Ivanov (4): drivers/vhost/blk: drop ring features already in VHOST_FEATURES drivers/vhost/blk: stop failing write zeroes above the backend limit drivers/vhost/blk: return UNSUPP for write zeroes on a backend without it drivers/vhost/blk: support VIRTIO_BLK_F_DISCARD drivers/vhost/blk.c | 110 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 85 insertions(+), 25 deletions(-) -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel