diff mbox series

[v3,08/18] block: allow serialized reads to intersect

Message ID 20181001102928.20533-9-vsementsov@virtuozzo.com
State New
Headers show
Series fleecing-hook driver for backup | expand

Commit Message

Vladimir Sementsov-Ogievskiy Oct. 1, 2018, 10:29 a.m. UTC
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 <vsementsov@virtuozzo.com>
---
 block/io.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

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,