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 076DA80031 for ; Tue, 1 Dec 2026 08:52:02 +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 6B18omRv021354; Tue, 1 Dec 2026 11:50:49 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6B18omRv021354 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="sqAAv7M3" Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6B18oGH2021218 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 1 Dec 2026 11:50:16 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6B18oGH2021218 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-c514c051a65so1033268566b.2 for ; Tue, 01 Dec 2026 00:50:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErEeyLIK3Tke8FhcIk5xEFVjlSOJ1mQNu0xtqBDsTnXcGFoZvd8UN3bLU2NSZw6ln3ikxKeGuA==@openvz.org X-Gm-Message-State: APuU4Z9c3SKiifxmRPhJbi5jN5evWJtmkCx7pPA2ixkQhv+Pfs5pGwsc 6YDI/rnNJp5UISU+NWf/QtZ/iDx95663yFFUoRpuu+g7/ui3GBDkbdQTVgvE04ONoEWaocdm9M5 XquRTCZ1XyMztduYlCJuB/gHZXTrM6HZ9pm8JTJRb4ZHfO0MKvRk3rw== X-Gm-Gg: AZFdTZdZMRTODS8HSyDzSTWPBgpyZWA4H9iMBqejzp8nOXibw1RNySXW2R1qAD8R/wu xU6FovshHQOOwHfeWcSFjbKM8SUsO6aPuDObcAm3+yW9BJcqx/qCJ4MWzUf+LTpEDWejDD1iiaW CrIC1EHuCq46NS3mGb0jOJawoRd08/wkMBYgiCms2EJAHNnbTwu/mv+D6eGvqC0VdHx+VD1rTXJ 926NJlOsk2v887H30uBvFRYTKog82x9C8qFjsRvYe5FsgNi0s6Jji63T13PwiccKTNGCEiDu3Sc gPu9IVejBGaXiVJSyChs30w+1fp8trQr+3p374MryzRlB5NLdjhO1LNFJ/8y1M1AA8n6h+AeKyu nA61dpZxFOIIuHGy/kBIE/c+u5eI= X-Received: by 2002:a17:906:8316:b0:c40:b59:f with SMTP id a640c23a62f3a-c513ab2c7admr2169823066b.47.1796115015921; Tue, 01 Dec 2026 00:50:15 -0800 (PST) X-Received: by 2002:a17:906:8316:b0:c40:b59:f with SMTP id a640c23a62f3a-c513ab2c7admr2169821966b.47.1796115015329; Tue, 01 Dec 2026 00:50:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1796115015; cv=none; d=google.com; s=arc-20260327; b=pezNeST2tuTbfDM9L3isCgufmHJZLFX4fJlSxF9C2Pgkq+mFmI+0nGdjYyDUlKu5Qi DFPFJCf3Cebz+ENFGo+gGOG0RefhCGvUirrKH3EgN04M5nQ98pSUnNys+Fee6ZDACebP zVYbextjL1cYTGPHPWkPC8HImwgZTM23E/OPSsGH47uq1Ie+wNMBrj1dqBF/Y73fGICI z7hAx2awQrelqWXL/MeInFQW8r3CTz/gYVakoBj8kerGIDzPTQInyNHu/imCmQ/VnS/k i6/ssAMsq7275fvpiTM0/86GwCWnC5Z/G9oRd1DoqDTxxooesdq5vM40KZD2FdShI7wU kV8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=CrDgF84oBmsrkGEQn+8b4RbLLQLIowQEZeyrw41VvTk=; fh=CMILZ+goaghq6B4UpCDhf0EQp6kYD0LAlmOkUiVCOvs=; b=op+jkvExaKIV48hoMOspzgA1EqEQS/oWgMzabsRG1SlAiaoFU4bDwfD9StNUXuOHx4 DbbVw71TY8lUtpxZ6QPM1UjT4rHZkWem17tu7pIwKGUK6va4htIhYZ9s8QRPrBuSXaj8 l2h78UTXrzWCWywrNZVR06vxa/H3wmz8KpXvFcz+aY8t18sIGm32hh/Px1CLHo5CwDvW pjtiv8wzaSrNmVPilQedEfcHVRe0ZufzcArHE5sPrRhIVq/TejGyxaywxF4n5O57nkOe dODkX9qgS98UKra85CMAzShs9vdlN06cDckW0fPr64oc8Rhi61R/X9rOg69vVneaUks6 mt0Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=sqAAv7M3; 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 a640c23a62f3a-c513b0a7748si2248889566b.311.2026.12.01.00.50.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 00:50:15 -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=sqAAv7M3; 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=CrDgF84oBmsrkGEQn+8b4RbLLQLIowQEZeyrw41VvTk=; b=sqAAv7M3kq6o UZiliWPb014Jy/QzLa1k+PWFNyefQaph8meg5iqeH6PQi7jSwSOZgirtOeyOm9g4+CXWDvN34bVva ISWiOh6GhTjLwHLXZlqi6yBuvbRZXIsCT47RHB1H3JnRXpLS70pku51GPJ+hEbGn1F/X653EMmSDs Zi2JZOdvipz7RE62R/Bsc4UqZyGm8v0wji+oKz3dNE2v9GbuYbdl8LYDiQxVh7kNcoHTZ92vvPQGR nKbKmDB6jOdu8KQMRwqumjDGTHiVYxAmEvSksrpI4hjL4KIUiD+xpx7uV/PrtAUqakPCpeIASTt6/ gtGjSmtisteY9ztLlEoWFg==; 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 1xYJYg-000HJA-2E; Tue, 01 Dec 2026 09:50:05 +0100 From: Alexander Ivanov To: andrey.zhadchenko@virtuozzo.com Date: Tue, 1 Dec 2026 09:50:09 +0100 Message-ID: <20261201085009.1884844-8-alexander.ivanov@virtuozzo.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261201085009.1884844-1-alexander.ivanov@virtuozzo.com> References: <20261201085009.1884844-1-alexander.ivanov@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.2 v3 7/7] dm-ploop: add the report_enospc table argument 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 A request failing with ENOSPC is delayed in dm-ploop and resubmitted every 20 seconds, and the error is reported with a dm event. A vhost-blk disk is controlled by QEMU, which cannot wait for dm events or send dm messages without CAP_SYS_ADMIN. So for a VM the request just hangs until space is freed, and the VM is never paused. vhost-blk is to hold a request failed with ENOSPC itself and let QEMU pause the VM and resubmit it on resume. That needs the error to reach vhost-blk. With the optional table argument report_enospc, such a request is completed with BLK_STS_NOSPC at once, and no dm event is raised. Without it nothing changes, which containers rely on. A flag set by a message would be lost on every table reload, as the reload creates a new target. So it is a table argument, which userspace has to pass with every table it loads: on a snapshot, a grow, a merge, a replace and a migration. The table status shows it as the 'r' flag, which userspace reads back to pass report_enospc again when it reloads the table. The target version goes to 1.1.0, as an older kernel takes the argument for a delta fd and fails the table load with EINVAL. https://virtuozzo.atlassian.net/browse/VSTOR-152175 Feature: dm-ploop: ploop target driver Signed-off-by: Alexander Ivanov Reviewed-by: Sashiko --- drivers/md/dm-ploop-map.c | 10 ++++++---- drivers/md/dm-ploop-target.c | 9 ++++++++- drivers/md/dm-ploop.h | 1 + 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c index 5f8de62a7099..50b7b33263ec 100644 --- a/drivers/md/dm-ploop-map.c +++ b/drivers/md/dm-ploop-map.c @@ -214,12 +214,14 @@ static void ploop_prq_endio(struct pio *pio, void *prq_ptr, css_put(prq->css); /* * Here is exit point for rq, and here we handle ENOSPC. - * Embedded pios will be reinitialized like they've just - * came from upper dm level, and later resubmitted after - * timeout. Note, that we do not handle merge here: merge - * callers receive -ENOSPC synchronous without intermediaries. + * Unless report_enospc is set, embedded pios will be + * reinitialized like they've just came from upper dm level, + * and later resubmitted after timeout. Note, that we do not + * handle merge here: merge callers receive -ENOSPC synchronous + * without intermediaries. */ if (unlikely(bi_status == BLK_STS_NOSPC) && + !pio->ploop->report_enospc && ploop_try_delay_enospc(prq, pio)) return; diff --git a/drivers/md/dm-ploop-target.c b/drivers/md/dm-ploop-target.c index 8dd436397acb..23bcc2da4fe4 100644 --- a/drivers/md/dm-ploop-target.c +++ b/drivers/md/dm-ploop-target.c @@ -614,6 +614,11 @@ static int ploop_ctr(struct dm_target *ti, unsigned int argc, char **argv) EAT_ARG(argc, argv); continue; } + if (strcmp(argv[0], "report_enospc") == 0) { + ploop->report_enospc = true; + EAT_ARG(argc, argv); + continue; + } #define PLOOP_MD_DELAY_ARG "metadata_delay=" if (strncmp(argv[0], PLOOP_MD_DELAY_ARG, sizeof(PLOOP_MD_DELAY_ARG) - 1) == 0) { if (kstrtou64(argv[0] + sizeof(PLOOP_MD_DELAY_ARG) - 1, 10, @@ -718,6 +723,8 @@ static void ploop_status(struct dm_target *ti, status_type_t type, *p++ = 'n'; if (READ_ONCE(ploop->event_enospc)) *p++ = 's'; + if (ploop->report_enospc) + *p++ = 'r'; if (p == stat) *p++ = 'o'; if (ploop->skip_off) @@ -915,7 +922,7 @@ ALLOW_ERROR_INJECTION(ploop_preresume, ERRNO); static struct target_type ploop_target = { .name = "ploop", - .version = {1, 0, 0}, + .version = {1, 1, 0}, .features = DM_TARGET_SINGLETON, .module = THIS_MODULE, .ctr = ploop_ctr, diff --git a/drivers/md/dm-ploop.h b/drivers/md/dm-ploop.h index f76b323ce6c2..d353fcac4fb9 100644 --- a/drivers/md/dm-ploop.h +++ b/drivers/md/dm-ploop.h @@ -273,6 +273,7 @@ struct ploop { struct timer_list enospc_timer; bool submit_enospc; /* timer expired run pios from dispatcher */ bool event_enospc; + bool report_enospc; loff_t prealloc_size; loff_t prealloc_in_progress; -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel