aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-12-14 12:46:18 -0800
committerRichard Henderson <richard.henderson@linaro.org>2021-12-14 12:46:18 -0800
commit76b56fdfc9fa43ec6e5986aee33f108c6c6a511e (patch)
treebd01e1597fa3ef858aea16e349c4ffddae2075d0
parentaf1719795c888938855b412b33192dfc7072962d (diff)
parentcf4fbc3030c974fff726756a7ceef8386cdf500b (diff)
downloadqemu-76b56fdfc9fa43ec6e5986aee33f108c6c6a511e.zip
qemu-76b56fdfc9fa43ec6e5986aee33f108c6c6a511e.tar.gz
qemu-76b56fdfc9fa43ec6e5986aee33f108c6c6a511e.tar.bz2
Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging
Pull request An infinite loop fix for the userspace NVMe driver. # gpg: Signature made Thu 09 Dec 2021 07:21:08 AM PST # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full] # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full] * tag 'block-pull-request' of https://gitlab.com/stefanha/qemu: block/nvme: fix infinite loop in nvme_free_req_queue_cb() Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--block/nvme.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block/nvme.c b/block/nvme.c
index e4f336d..fa360b9 100644
--- a/block/nvme.c
+++ b/block/nvme.c
@@ -206,8 +206,9 @@ static void nvme_free_req_queue_cb(void *opaque)
NVMeQueuePair *q = opaque;
qemu_mutex_lock(&q->lock);
- while (qemu_co_enter_next(&q->free_req_queue, &q->lock)) {
- /* Retry all pending requests */
+ while (q->free_req_head != -1 &&
+ qemu_co_enter_next(&q->free_req_queue, &q->lock)) {
+ /* Retry waiting requests */
}
qemu_mutex_unlock(&q->lock);
}