From: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
To: andrey.zhadchenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.2 7/7] dm-ploop: add the report_enospc table argument
Date: Fri, 27 Nov 2026 12:15:50 +0100 [thread overview]
Message-ID: <20261127111550.1151546-8-alexander.ivanov@virtuozzo.com> (raw)
In-Reply-To: <20261127111550.1151546-1-alexander.ivanov@virtuozzo.com>
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 passes with every table it loads. The table status shows it
as the 'r' flag.
https://virtuozzo.atlassian.net/browse/VSTOR-152175
Feature: dm-ploop: ploop target driver
Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
---
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
next prev parent reply other threads:[~2026-11-27 11:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 11:15 [Devel] [PATCH hci-8.2 0/7] dm-qcow2, dm-ploop: report ENOSPC at once for vhost-blk disks Alexander Ivanov
2026-11-27 11:15 ` [Devel] [PATCH hci-8.2 1/7] dm-qcow2: always resubmit delayed ENOSPC requests in presuspend Alexander Ivanov
2026-11-27 11:15 ` [Devel] [PATCH hci-8.2 2/7] dm-qcow2: arm the ENOSPC timer only for the first delayed request Alexander Ivanov
2026-11-27 11:51 ` Konstantin Khorenko
2026-11-27 11:15 ` [Devel] [PATCH hci-8.2 3/7] dm-qcow2: drop the WARN on a read failing with ENOSPC Alexander Ivanov
2026-11-27 11:51 ` Konstantin Khorenko
2026-11-27 11:15 ` [Devel] [PATCH hci-8.2 4/7] dm-ploop: arm the ENOSPC timer only for the first delayed request Alexander Ivanov
2026-11-27 11:15 ` [Devel] [PATCH hci-8.2 5/7] dm-ploop: drop the WARN on a non-write request failing with ENOSPC Alexander Ivanov
2026-11-27 11:15 ` [Devel] [PATCH hci-8.2 6/7] dm-qcow2: add the report_enospc table argument Alexander Ivanov
2026-11-27 11:51 ` Konstantin Khorenko
2026-11-27 11:15 ` Alexander Ivanov [this message]
2026-11-27 11:51 ` [Devel] [PATCH hci-8.2 7/7] dm-ploop: " Konstantin Khorenko
2026-11-27 11:51 ` [Devel] [PATCH hci-8.2 0/7] dm-qcow2, dm-ploop: report ENOSPC at once for vhost-blk disks Konstantin Khorenko
2026-11-30 9:14 ` Alexander Ivanov
2026-11-30 16:27 ` Konstantin Khorenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261127111550.1151546-8-alexander.ivanov@virtuozzo.com \
--to=alexander.ivanov@virtuozzo.com \
--cc=andrey.zhadchenko@virtuozzo.com \
--cc=devel@openvz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox