diff mbox

[6/7] commit: Add 'base' to the reopen queue before 'overlay_bs'

Message ID 226771a1872ae391859397e45c960eaba63d2bd0.1473867967.git.berto@igalia.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alberto Garcia Sept. 14, 2016, 3:52 p.m. UTC
Now that we're checking for duplicates in the reopen queue, there's no
need to force a specific order in which the queue is constructed so we
can revert 3db2bd5508c86a1605258bc77c9672d93b5c350e.

Since both ways of constructing the queue are now valid, this patch
doesn't have any effect on the behavior of QEMU and is not strictly
necessary. However it can help us check that the fix for the reopen
queue is robust: if it stops working properly at some point, iotest
040 will break.

Signed-off-by: Alberto Garcia <berto@igalia.com>
---
 block/commit.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Kevin Wolf Sept. 15, 2016, 1:06 p.m. UTC | #1
Am 14.09.2016 um 17:52 hat Alberto Garcia geschrieben:
> Now that we're checking for duplicates in the reopen queue, there's no
> need to force a specific order in which the queue is constructed so we
> can revert 3db2bd5508c86a1605258bc77c9672d93b5c350e.
> 
> Since both ways of constructing the queue are now valid, this patch
> doesn't have any effect on the behavior of QEMU and is not strictly
> necessary. However it can help us check that the fix for the reopen
> queue is robust: if it stops working properly at some point, iotest
> 040 will break.
> 
> Signed-off-by: Alberto Garcia <berto@igalia.com>

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
diff mbox

Patch

diff --git a/block/commit.c b/block/commit.c
index 553e18d..3ab5e0c 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -243,14 +243,14 @@  void commit_start(const char *job_id, BlockDriverState *bs,
     orig_overlay_flags = bdrv_get_flags(overlay_bs);
 
     /* convert base & overlay_bs to r/w, if necessary */
-    if (!(orig_overlay_flags & BDRV_O_RDWR)) {
-        reopen_queue = bdrv_reopen_queue(reopen_queue, overlay_bs, NULL,
-                                         orig_overlay_flags | BDRV_O_RDWR);
-    }
     if (!(orig_base_flags & BDRV_O_RDWR)) {
         reopen_queue = bdrv_reopen_queue(reopen_queue, base, NULL,
                                          orig_base_flags | BDRV_O_RDWR);
     }
+    if (!(orig_overlay_flags & BDRV_O_RDWR)) {
+        reopen_queue = bdrv_reopen_queue(reopen_queue, overlay_bs, NULL,
+                                         orig_overlay_flags | BDRV_O_RDWR);
+    }
     if (reopen_queue) {
         bdrv_reopen_multiple(reopen_queue, &local_err);
         if (local_err != NULL) {