[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 8/8] curl: Fix hang reading from slow connections
From: |
Matthew Booth |
Subject: |
[Qemu-devel] [PATCH 8/8] curl: Fix hang reading from slow connections |
Date: |
Tue, 29 Apr 2014 16:03:32 +0100 |
When receiving a new aio read request, we first look for an existing
transaction whose range will cover the read request by the time it
completes. However, we weren't checking that the existing transaction
was still active. If it had timed out, we were adding the request to a
transaction which would never complete and had already been cancelled,
resulting in a hang.
Signed-off-by: Matthew Booth <address@hidden>
---
block/curl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/curl.c b/block/curl.c
index 16e7db8..d2f1084 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -220,7 +220,8 @@ static int curl_find_buf(BDRVCURLState *s, size_t start,
size_t len,
}
// Wait for unfinished chunks
- if ((start >= state->buf_start) &&
+ if (state->in_use &&
+ (start >= state->buf_start) &&
(start <= buf_fend) &&
(end >= state->buf_start) &&
(end <= buf_fend))
--
1.9.0
- [Qemu-devel] [PATCH 0/8] curl: Fix hang reading from slow connections, Matthew Booth, 2014/04/29
- [Qemu-devel] [PATCH 1/8] curl: Fix long line, Matthew Booth, 2014/04/29
- [Qemu-devel] [PATCH 2/8] curl: Remove unnecessary use of goto, Matthew Booth, 2014/04/29
- [Qemu-devel] [PATCH 5/8] curl: Remove unnecessary explicit calls to internal event handler, Matthew Booth, 2014/04/29
- [Qemu-devel] [PATCH 4/8] curl: Remove erroneous sleep waiting for curl completion, Matthew Booth, 2014/04/29
- [Qemu-devel] [PATCH 7/8] curl: Ensure all informationals are checked for completion, Matthew Booth, 2014/04/29
- [Qemu-devel] [PATCH 3/8] curl: Fix return from curl_read_cb with invalid state, Matthew Booth, 2014/04/29
- [Qemu-devel] [PATCH 6/8] curl: Eliminate unnecessary use of curl_multi_socket_all, Matthew Booth, 2014/04/29
- [Qemu-devel] [PATCH 8/8] curl: Fix hang reading from slow connections,
Matthew Booth <=
- Re: [Qemu-devel] [PATCH 0/8] curl: Fix hang reading from slow connections, Richard W.M. Jones, 2014/04/29
- Re: [Qemu-devel] [PATCH 0/8] curl: Fix hang reading from slow connections, Kevin Wolf, 2014/04/30