All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [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

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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.