* [Devel] [PATCH hci-8.2] dm-qcow2: fail an image write that returns 0 bytes instead of looping
@ 2026-11-23 15:38 Denis V. Lunev
2026-11-23 15:49 ` no-reply
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Denis V. Lunev @ 2026-11-23 15:38 UTC (permalink / raw)
To: andrey.zhadchenko, alexander.ivanov, vasileios.almpanis; +Cc: devel
From: Denis V. Lunev <den@openvz.org>
data_rw_complete() ends a short image read that transferred nothing
with -EIO, but resubmits such a write unchanged after
WARN_ON_ONCE(qio->ret == 0). ext4, xfs and NFS never complete a direct
write with 0 bytes, but FUSE does when the daemon opens the file with
FOPEN_DIRECT_IO, async_dio is off and the daemon replies 0 bytes
written. The dm-qcow2 worker then resubmits the same write forever,
and the guest write never completes.
Fail a write that makes no progress with -EIO, as FUSE with async_dio
and NFS already do for it, and drop the WARN_ON_ONCE() that no longer
has a case to catch.
https://virtuozzo.atlassian.net/browse/VSTOR-156109
Fixes: 222b6f1291c1 ("dm-qcow2: Introduce driver to create block devices over QCOW2 files")
Feature: dm-qcow2: block device over QCOW2 files driver
Signed-off-by: Denis V. Lunev <den@openvz.org>
---
drivers/md/dm-qcow2-map.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
index 853e7a1230ee..9a1ac023aa95 100644
--- a/drivers/md/dm-qcow2-map.c
+++ b/drivers/md/dm-qcow2-map.c
@@ -3029,11 +3029,10 @@ static void data_rw_complete(struct qio *qio)
zero_fill_qio(qio, qio->ret, qio->bi_iter.bi_size - qio->ret);
else
bi_status = BLK_STS_IOERR;
- } else if ((!write && qio->ret == 0) ||
+ } else if (qio->ret == 0 ||
(qio->ret > 0 && (qio->ret & (SECTOR_SIZE - 1)))) {
bi_status = BLK_STS_IOERR;
- } else if (qio->ret >= 0) {
- WARN_ON_ONCE(qio->ret == 0);
+ } else if (qio->ret > 0) {
qio_advance(qio, qio->ret);
qcow2_queue_resubmit(qio);
return;
--
2.55.0
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Devel] [PATCH hci-8.2] dm-qcow2: fail an image write that returns 0 bytes instead of looping
2026-11-23 15:38 [Devel] [PATCH hci-8.2] dm-qcow2: fail an image write that returns 0 bytes instead of looping Denis V. Lunev
@ 2026-11-23 15:49 ` no-reply
2026-11-25 8:15 ` Alexander Ivanov
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: no-reply @ 2026-11-23 15:49 UTC (permalink / raw)
To: Denis V. Lunev, andrey.zhadchenko, alexander.ivanov, vasileios.almpanis
Cc: devel
> From: Denis V. Lunev <den@openvz.org>
>
> data_rw_complete() ends a short image read that transferred nothing
> with -EIO, but resubmits such a write unchanged after
> WARN_ON_ONCE(qio->ret == 0). ext4, xfs and NFS never complete a direct
> write with 0 bytes, but FUSE does when the daemon opens the file with
> FOPEN_DIRECT_IO, async_dio is off and the daemon replies 0 bytes
> written. The dm-qcow2 worker then resubmits the same write forever,
> and the guest write never completes.
>
> Fail a write that makes no progress with -EIO, as FUSE with async_dio
> and NFS already do for it, and drop the WARN_ON_ONCE() that no longer
> has a case to catch.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-156109
>
> Fixes: 222b6f1291c1 ("dm-qcow2: Introduce driver to create block devices over QCOW2 files")
> Feature: dm-qcow2: block device over QCOW2 files driver
> Signed-off-by: Denis V. Lunev <den@openvz.org>
Sashiko has reviewed this patch and found no issues.
Carry the trailer below into the next revision and Sashiko will not review this patch again.
Reviewed-by: Sashiko <no-reply@sashiko.virtuozzo.com>
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261123153817.128600-1-den@openvz.org?part=1
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Devel] [PATCH hci-8.2] dm-qcow2: fail an image write that returns 0 bytes instead of looping
2026-11-23 15:38 [Devel] [PATCH hci-8.2] dm-qcow2: fail an image write that returns 0 bytes instead of looping Denis V. Lunev
2026-11-23 15:49 ` no-reply
@ 2026-11-25 8:15 ` Alexander Ivanov
2026-11-25 9:24 ` Vasileios Almpanis
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Alexander Ivanov @ 2026-11-25 8:15 UTC (permalink / raw)
To: Denis V. Lunev, andrey.zhadchenko, vasileios.almpanis; +Cc: devel
LGTM
Reviewed-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Devel] [PATCH hci-8.2] dm-qcow2: fail an image write that returns 0 bytes instead of looping
2026-11-23 15:38 [Devel] [PATCH hci-8.2] dm-qcow2: fail an image write that returns 0 bytes instead of looping Denis V. Lunev
2026-11-23 15:49 ` no-reply
2026-11-25 8:15 ` Alexander Ivanov
@ 2026-11-25 9:24 ` Vasileios Almpanis
2026-11-30 15:02 ` Konstantin Khorenko
2026-11-30 15:02 ` Konstantin Khorenko
4 siblings, 0 replies; 6+ messages in thread
From: Vasileios Almpanis @ 2026-11-25 9:24 UTC (permalink / raw)
To: Denis V. Lunev; +Cc: devel
On Mon, 23 Nov 2026 16:38:17 +0100, Denis V. Lunev <den@openvz.org> wrote:
> data_rw_complete() ends a short image read that transferred nothing
> with -EIO, but resubmits such a write unchanged after
> WARN_ON_ONCE(qio->ret == 0). ext4, xfs and NFS never complete a direct
> write with 0 bytes, but FUSE does when the daemon opens the file with
> FOPEN_DIRECT_IO, async_dio is off and the daemon replies 0 bytes
> written. The dm-qcow2 worker then resubmits the same write forever,
> and the guest write never completes.
>
> [...]
Reviewed-by: Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>
--
Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Devel] [PATCH hci-8.2] dm-qcow2: fail an image write that returns 0 bytes instead of looping
2026-11-23 15:38 [Devel] [PATCH hci-8.2] dm-qcow2: fail an image write that returns 0 bytes instead of looping Denis V. Lunev
` (2 preceding siblings ...)
2026-11-25 9:24 ` Vasileios Almpanis
@ 2026-11-30 15:02 ` Konstantin Khorenko
2026-11-30 15:02 ` Konstantin Khorenko
4 siblings, 0 replies; 6+ messages in thread
From: Konstantin Khorenko @ 2026-11-30 15:02 UTC (permalink / raw)
To: Denis V. Lunev; +Cc: devel
Applying with these fixes on my side:
- message: "async_dio is off" -> "async_dio and writeback_cache are
both off", "as FUSE with async_dio" -> "as asynchronous FUSE direct
I/O";
- message: the first paragraph split into what the code does, which
file system returns 0 bytes and what the guest sees, which now also
says that a suspend of the device waits for the stuck write.
On Mon, 23 Nov 2026 16:38:17 +0100, Denis V. Lunev wrote:
> FOPEN_DIRECT_IO, async_dio is off and the daemon replies 0 bytes
> written.
In the vz tree fuse_direct_IO() sets io->async = async_dio |
writeback_cache, so a writeback_cache mount takes the asynchronous
path and already fails such a write with -EIO.
> written. The dm-qcow2 worker then resubmits the same write forever,
> and the guest write never completes.
The stuck qio keeps its inflight reference, so a suspend (snapshot,
resize, CT stop) hangs on it as well.
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Devel] [PATCH hci-8.2] dm-qcow2: fail an image write that returns 0 bytes instead of looping
2026-11-23 15:38 [Devel] [PATCH hci-8.2] dm-qcow2: fail an image write that returns 0 bytes instead of looping Denis V. Lunev
` (3 preceding siblings ...)
2026-11-30 15:02 ` Konstantin Khorenko
@ 2026-11-30 15:02 ` Konstantin Khorenko
4 siblings, 0 replies; 6+ messages in thread
From: Konstantin Khorenko @ 2026-11-30 15:02 UTC (permalink / raw)
To: andrey.zhadchenko, alexander.ivanov, vasileios.almpanis, Denis V. Lunev
Cc: devel
On Mon, 23 Nov 2026 16:38:17 +0100, Denis V. Lunev wrote:
> dm-qcow2: fail an image write that returns 0 bytes instead of looping
Applied to branch-rh10-6.12.0-211.75.1.26.x.vz10-ovz, will be released in rh10-6.12.0-211.75.1.26.6.vz10, thanks!
[1/1] dm-qcow2: fail an image write that returns 0 bytes instead of looping
https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/b48c2a53ff7f
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-11-30 15:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23 15:38 [Devel] [PATCH hci-8.2] dm-qcow2: fail an image write that returns 0 bytes instead of looping Denis V. Lunev
2026-11-23 15:49 ` no-reply
2026-11-25 8:15 ` Alexander Ivanov
2026-11-25 9:24 ` Vasileios Almpanis
2026-11-30 15:02 ` Konstantin Khorenko
2026-11-30 15:02 ` Konstantin Khorenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox