[Devel] [PATCH hci-8.2 2/2] dm-qcow2: end the popped qio when decompression setup fails

Denis V. Lunev den at openvz.org
Thu Nov 19 17:30:26 MSK 2026


From: Denis V. Lunev <den at openvz.org>

process_compressed_read() pops a qio and only then allocates the
decompression buffer and, for zstd, sets up the decompression context.
If either fails, it ends the qios left on the list but not the popped one,
which never completes: a read or COW of a compressed cluster hangs,
and so does a backward merge that waits for it.

Put the popped qio back on the list before ending them.

https://virtuozzo.atlassian.net/browse/VSTOR-156064

Fixes: e6bcdf575c18 ("dm-qcow2: support mixed compression images")
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 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/md/dm-qcow2-map.c b/drivers/md/dm-qcow2-map.c
index 990896d68016..8f3e89de73c0 100644
--- a/drivers/md/dm-qcow2-map.c
+++ b/drivers/md/dm-qcow2-map.c
@@ -4116,6 +4116,7 @@ static void process_compressed_read(struct list_head *read_list,
 					QC_ERR(qcow2->tgt->ti,
 					       "can not allocate decompression buffer:%zu",
 					       qcow2->clu_size + dctxlen);
+					list_add(&qio->link, read_list);
 					end_qios(read_list, BLK_STS_RESOURCE);
 					return;
 				}
@@ -4126,6 +4127,7 @@ static void process_compressed_read(struct list_head *read_list,
 				arg = zstd_init_dstream(qcow2->clu_size,
 							buf + qcow2->clu_size, dctxlen);
 				if (!arg) {
+					list_add(&qio->link, read_list);
 					end_qios(read_list, BLK_STS_RESOURCE);
 					kvfree(buf);
 					return;
-- 
2.55.0



More information about the Devel mailing list