From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6vSN-0004qg-MY for qemu-devel@nongnu.org; Mon, 01 Oct 2018 06:29:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6vSK-0002Lj-Ry for qemu-devel@nongnu.org; Mon, 01 Oct 2018 06:29:39 -0400 From: Vladimir Sementsov-Ogievskiy Date: Mon, 1 Oct 2018 13:29:18 +0300 Message-Id: <20181001102928.20533-9-vsementsov@virtuozzo.com> In-Reply-To: <20181001102928.20533-1-vsementsov@virtuozzo.com> References: <20181001102928.20533-1-vsementsov@virtuozzo.com> Subject: [Qemu-devel] [PATCH v3 08/18] block: allow serialized reads to intersect List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-block@nongnu.org Cc: eblake@redhat.com, armbru@redhat.com, xiechanglong.d@gmail.com, wencongyang2@huawei.com, stefanha@redhat.com, jsnow@redhat.com, famz@redhat.com, jcody@redhat.com, mreitz@redhat.com, kwolf@redhat.com, vsementsov@virtuozzo.com, den@openvz.org Otherwise, if we have serialized read-part in copy_range from backing file to its parent if CoW take place, this CoW's sub-reads will intersect with firstly created serialized read request. Anyway, reads should not influence on disk view, let's allow them to intersect. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/io.c b/block/io.c index b003b4d5bf..6d611bfe59 100644 --- a/block/io.c +++ b/block/io.c @@ -735,7 +735,8 @@ static bool coroutine_fn wait_serialising_requests(BdrvTrackedRequest *self) retry = false; qemu_co_mutex_lock(&bs->reqs_lock); QLIST_FOREACH(req, &bs->tracked_requests, list) { - if (req == self || (!req->serialising && !self->serialising)) { + if (req == self || (!req->serialising && !self->serialising) || + (self->type == BDRV_TRACKED_READ && req->type == self->type)) { continue; } if (tracked_request_overlaps(req, self->overlap_offset, -- 2.18.0