All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: andrey.zhadchenko@virtuozzo.com, alexander.ivanov@virtuozzo.com,
	vasileios.almpanis@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.2] dm-qcow2: fail an image write that returns 0 bytes instead of looping
Date: Mon, 23 Nov 2026 16:38:17 +0100	[thread overview]
Message-ID: <20261123153817.128600-1-den@openvz.org> (raw)

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

             reply	other threads:[~2026-11-23 15:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 15:38 Denis V. Lunev [this message]
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

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=20261123153817.128600-1-den@openvz.org \
    --to=den@openvz.org \
    --cc=alexander.ivanov@virtuozzo.com \
    --cc=andrey.zhadchenko@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=vasileios.almpanis@virtuozzo.com \
    /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 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.