[Devel] [PATCH hci-8.2] dm-qcow2: fail an image write that returns 0 bytes instead of looping
Denis V. Lunev
den at openvz.org
Mon Nov 23 18:38:17 MSK 2026
From: Denis V. Lunev <den at 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 at 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
More information about the Devel
mailing list