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 DA6BF80031 for ; Mon, 30 Nov 2026 16:26:36 +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 6AUGPNek019728; Mon, 30 Nov 2026 19:25:24 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AUGPNek019728 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="jmk6j3tU" Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AUGP1lV019620 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 30 Nov 2026 19:25:02 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AUGP1lV019620 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-c50547b4992so745508966b.3 for ; Mon, 30 Nov 2026 08:25:02 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErFoC8w1oDrcOUeESJRZx+Uvrn+uNKWaNaHD7p7DrbDjjjtenTeptLIRvAy0XSS4RcsjM+fc9Q==@openvz.org X-Gm-Message-State: APuU4Z8EQpvSmF90qcWKuy0PLtU+LBtvvJNTRJLr0SAT2CttD5iv2lSx qjgXkcgIWo+2HLI7T+IdYnr+xiHvS6KukXclbXYLqrjg3h67mUx8wOTmD5bknkvCnQWueq59OHp HN8wWWNJBDYY4z8dtkqTtaH939opMLvUtX/77JqCrpfeDMBFX163rEQ== X-Gm-Gg: AZFdTZf27PtigBVJ1w/Z64sbmkWXLsikzhd/WvqXiyK2JllBMPewF+CnlT0VKQVUHPk yL7QzTP63h+gupTOk/IYNNpagqB9OJgAR37dpTqeTwZk16z5JOUdzwRlf09sOleVxplJgH45OF0 V7+Lpwxr3l7em6pZWGNYuj00yn3NHKK369xiqfm+MC6kvk/XQqJwrkz0c8VkRIFQkPc+tAx5z5u qYmRLseF060F6CFidoA6S58243O/z4d++w2csyHJ/ztIm5h5amIlyzLqnF6HzY1IJvoteTuZbg3 skzaQ5ylI1XlTHa7sWEJcZdk+Yp2uFrhEpqVG2QHbnnh5++Tqdx4Dd9JvuE4FRgCeDxxOFDyjKP WBqCRHL2v3IXsHLL3pABp33eIj8+Q X-Received: by 2002:a17:907:c07:b0:c50:c04d:cbb3 with SMTP id a640c23a62f3a-c516adc890cmr2172431066b.0.1796055901543; Mon, 30 Nov 2026 08:25:01 -0800 (PST) X-Received: by 2002:a17:907:c07:b0:c50:c04d:cbb3 with SMTP id a640c23a62f3a-c516adc890cmr2172428866b.0.1796055900971; Mon, 30 Nov 2026 08:25:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1796055900; cv=none; d=google.com; s=arc-20260327; b=RBg5YbCjQLzGxuJE14Qdm8H6nPpQtcT/nYb2pD7DFVgVmP03QLQdwezRHmLuAzeunz ciExmVooWJg0RCzevCbFN+5lwEzRQ7K+SceL8N6kh38XpVAEAntr8SBCLSGlJeOMtBPQ pkhaB2TrxnyWJyhwIJuC+YOsupbzptweeaHvfqb1Buw45K22RdwYReDWC+c0TPEgVdoL jcXKqix+l38brP2hAP62fguY1+ScIawNmRQ160TAhQJEjGCAe4OQS6C85BE3DIJG3Dj3 3ogK5EN5irOXqM5sEJaWSz5qRmlyZZrVaIXi24pTW2HjeSxFDVkJaJgg1p5LDJmisjSK /+ag== 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=YYLA08PTd7eKNKVQpHyVDVSc6Y2zb4rw/lCkVYuCMfk=; fh=CMILZ+goaghq6B4UpCDhf0EQp6kYD0LAlmOkUiVCOvs=; b=grTtW7BJafuufbY+f+fGc/cMljMorpY+2XdE22WJf35r8msOSdyxGx6y4lvmy9xX5x AvcWyZO28zZbc2DKRjdxgaNl3r7+ochostMr/XSMeBTec83d/IbkZoMjjfWmtR5XYVmd tRbtQUVV20MYw40IzQvWstP4Y70wg89xlZ36SsUG7JgYcKOBR6g5mCuB2ms4Ty9UIAS0 ljryMNXWRZ9XDUwxcwpipn9iALVHxr7/mQUQeERgch/Y+TlW21kHnZE2tChK9ogM5fXf XZf11WNf2M3aE+PwjDqhmx/qtRI58+93620mYC+vHGGJ6XsdAImZZT8Rl+v3qWlyp1DA bKAg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=jmk6j3tU; 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-c513b06d286si2123513166b.228.2026.11.30.08.25.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 08:25:00 -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=jmk6j3tU; 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=YYLA08PTd7eKNKVQpHyVDVSc6Y2zb4rw/lCkVYuCMfk=; b=jmk6j3tUEjCe wMxFocy/bQXJCpFGIfXtMfcUMT5ffuRTQq+cS77Gtm5tAxCm++QghDCSoNY5oKdrK5XIV8M40ExuL CsMo3erZ/GIEqeSHx87VBdGSPrA+TH8AV3GJEO36I/yTyVgFzbCrf/gr07bmIW/j1QmTO0OUgS0Qc Rw7g3hpeOePK8fJVQ7wmODxOjOjW+ub5MdtbL18D+qQ0dnxehmW1IJ49m5L2NSXcMl/icng9St06y oGucUhEA19/2mIIFe85qpoibh4fqrnxWMj2Cn10/bBZVnUJpcbBStguZ1wHZ2jEvCSue3qGAewHUh Lmn7pOdHtsbaotg0QGQnRg==; 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 1xY4BF-00Gm7s-1j; Mon, 30 Nov 2026 17:24:52 +0100 From: Alexander Ivanov To: andrey.zhadchenko@virtuozzo.com Date: Mon, 30 Nov 2026 17:24:56 +0100 Message-ID: <20261130162456.1822406-8-alexander.ivanov@virtuozzo.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261130162456.1822406-1-alexander.ivanov@virtuozzo.com> References: <20261130162456.1822406-1-alexander.ivanov@virtuozzo.com> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.2 v2 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 --- 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 131102da4c0a..66939a6f5d4b 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 aefb69e8a40b..872bf481281d 100644 --- a/drivers/md/dm-ploop-target.c +++ b/drivers/md/dm-ploop-target.c @@ -615,6 +615,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, @@ -722,6 +727,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) @@ -812,7 +819,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 093b7f9397a4..fbfecf8139f5 100644 --- a/drivers/md/dm-ploop.h +++ b/drivers/md/dm-ploop.h @@ -266,6 +266,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