qemu-kvm/kvm-block-curl-fix-concurrent-completion-handling.patch
Jon Maloy b0c44badd0 * Fri Aug 21 2026 Jon Maloy <jmaloy@redhat.com> - 10.1.0-24
- kvm-block-graph-lock-fix-missed-wakeup-in-bdrv_graph_co_.patch [RHEL-216952]
- kvm-block-curl-fix-curl-internal-handles-handling.patch [RHEL-216952]
- kvm-block-curl.c-Use-explicit-long-constants-in-curl_eas.patch [RHEL-216952]
- kvm-block-curl.c-Fix-CURLOPT_VERBOSE-parameter-type.patch [RHEL-216952]
- kvm-block-curl-fix-concurrent-completion-handling.patch [RHEL-216952]
- kvm-block-curl-free-s-password-in-cleanup-paths.patch [RHEL-216952]
- kvm-nvme-Kick-and-check-completions-in-BDS-context.patch [RHEL-216952]
- kvm-nvme-Note-in-which-AioContext-some-functions-run.patch [RHEL-216952]
- kvm-block-remove-detached-header-option-from-opts-after-.patch [RHEL-216952]
- kvm-block-fix-luks-amend-when-run-in-coroutine.patch [RHEL-216952]
- kvm-qed-Don-t-try-to-flush-during-incoming-migration.patch [RHEL-216952]
- kvm-block-vmdk-fix-OOB-read-in-vmdk_read_extent.patch [RHEL-216952]
- kvm-block-throttle-groups-fix-deadlock-with-iolimits-and.patch [RHEL-216952]
- kvm-throttle-group-Fix-race-condition-in-throttle_group_.patch [RHEL-216952]
- kvm-qemu-img-Fix-amend-option-parse-error-handling.patch [RHEL-216952]
- kvm-qemu-img-rebase-don-t-exceed-IO_BUF_SIZE-in-one-oper.patch [RHEL-216952]
- kvm-python-backport-drop-Python3.6-workarounds.patch [RHEL-216952]
- kvm-python-backport-Remove-deprecated-get_event_loop-cal.patch [RHEL-216952]
- kvm-python-backport-avoid-creating-additional-event-loop.patch [RHEL-216952]
- kvm-iotests-147-ensure-temporary-sockets-are-closed-befo.patch [RHEL-216952]
- kvm-iotests-151-ensure-subprocesses-are-cleaned-up.patch [RHEL-216952]
- kvm-tests-qemu-iotest-fix-iotest-024-with-qed-images.patch [RHEL-216952]
- kvm-tests-qemu-iotests-Fix-check-for-existing-file-in-_r.patch [RHEL-216952]
- kvm-async-access-bottom-half-flags-with-qatomic_read.patch [RHEL-216952]
- kvm-block-linux-aio-bound-ioq_submit-recursion-depth.patch [RHEL-216952]
- kvm-block-io-fallback-to-bounce-buffer-if-BLKZEROOUT-is-.patch [RHEL-216952]
- kvm-file-posix-populate-pwrite_zeroes_alignment.patch [RHEL-216952]
- kvm-block-use-pwrite_zeroes_alignment-when-writing-first.patch [RHEL-216952]
- kvm-iotests-add-Linux-loop-device-image-creation-test.patch [RHEL-216952]
- kvm-virtio-Fix-crash-when-sriov-pf-is-set-for-non-PCI-Ex.patch [RHEL-216952]
- kvm-virtio-scsi-pass-the-same-cdb_size-to-virtio_scsi_po.patch [RHEL-216952]
- kvm-hw-scsi-avoid-deadlock-upon-TMF-request-cancelling-w.patch [RHEL-216952]
- kvm-virtio-blk-fix-zone-report-buffer-out-of-memory-CVE-.patch [RHEL-216952]
- kvm-ide-Fix-potential-assertion-failure-on-VM-stop-for-P.patch [RHEL-216952]
- kvm-block-Create-DEFAULT_BLOCK_CONF-macro.patch [RHEL-216952]
- kvm-block-Add-more-defaults-to-DEFAULT_BLOCK_CONF.patch [RHEL-216952]
- kvm-block-mirror-check-range-when-setting-zero-bitmap-fo.patch [RHEL-216952]
- kvm-iotests-test-active-mirror-with-unaligned-small-writ.patch [RHEL-216952]
- kvm-block-mirror-fix-assertion-failure-upon-duplicate-co.patch [RHEL-216952]
- kvm-commit-Drain-nodes-across-all-of-bdrv_commit.patch [RHEL-216952]
- kvm-qemu-io-Add-aio_discard-command.patch [RHEL-216952]
- kvm-qcow2-Fix-corruption-on-discard-during-write-with-CO.patch [RHEL-216952]
- kvm-iotests-046-Test-that-discard-write_zeroes-wait-for-.patch [RHEL-216952]
- kvm-qcow2-Fix-data-loss-on-zero-write-with-detect-zeroes.patch [RHEL-216952]
- kvm-block-Fix-crash-after-setting-latency-historygram-wi.patch [RHEL-216952]
- Resolves: RHEL-216952
  (virt-storage: Backport stable branch fixes [rhel-9])
2026-08-21 16:11:29 -04:00

72 lines
2.4 KiB
Diff

From 9c41cbeaf2333f17135c58564f7ffad54392591c Mon Sep 17 00:00:00 2001
From: Antoine Damhet <adamhet@scaleway.com>
Date: Thu, 12 Feb 2026 17:27:24 +0100
Subject: [PATCH 05/45] block/curl: fix concurrent completion handling
RH-Author: Kevin Wolf <kwolf@redhat.com>
RH-MergeRequest: 515: virt-storage: Backport stable branch fixes [9.9]
RH-Jira: RHEL-216952
RH-Acked-by: Hanna Czenczek <hreitz@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Commit: [5/45] 0e585ff9ebf5e07867b0bac5a7de199766aac4fb (kmwolf/centos-qemu-kvm)
curl_multi_check_completion would bail upon the first completed
transfer even if more completion messages were available thus leaving
some in flight IOs stuck.
Rework a bit the loop to make the iterations clearer and drop the breaks.
The original hang can be somewhat reproduced with the following command:
$ qemu-img convert -p -m 16 -O qcow2 -c --image-opts \
'file.driver=https,file.url=https://scaleway.testdebit.info/10G.iso,file.readahead=1M' \
/tmp/test.qcow2
Fixes: 1f2cead32443 ("curl: Ensure all informationals are checked for completion")
Cc: qemu-stable@nongnu.org
Signed-off-by: Antoine Damhet <adamhet@scaleway.com>
Message-ID: <20260212162730.440855-2-adamhet@scaleway.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 6f7b0a23a6ea0cc72ad222ab37936248d99d4256)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/curl.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/block/curl.c b/block/curl.c
index 96498aac1d..dabd2a905e 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -324,17 +324,11 @@ curl_find_buf(BDRVCURLState *s, uint64_t start, uint64_t len, CURLAIOCB *acb)
static void curl_multi_check_completion(BDRVCURLState *s)
{
int msgs_in_queue;
+ CURLMsg *msg;
/* Try to find done transfers, so we can free the easy
* handle again. */
- for (;;) {
- CURLMsg *msg;
- msg = curl_multi_info_read(s->multi, &msgs_in_queue);
-
- /* Quit when there are no more completions */
- if (!msg)
- break;
-
+ while ((msg = curl_multi_info_read(s->multi, &msgs_in_queue))) {
if (msg->msg == CURLMSG_DONE) {
int i;
CURLState *state = NULL;
@@ -397,7 +391,6 @@ static void curl_multi_check_completion(BDRVCURLState *s)
}
curl_clean_state(state);
- break;
}
}
}
--
2.52.0