[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] commit: reopen overlay_bs before base
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] commit: reopen overlay_bs before base |
Date: |
Fri, 30 Oct 2015 20:14:33 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 28.10.2015 14:43, Alberto Garcia wrote:
> 'block-commit' needs write access to two different nodes of the chain:
>
> - 'base', because that's where the data is written to.
> - the overlay of 'top', because it needs to update the backing file
> string to point to 'base' after the operation.
>
> Both images have to be opened in read-write mode, and commit_start()
> takes care of reopening them if necessary.
>
> With the current implementation, however, when overlay_bs is reopened
> in read-write mode it has the side effect of making 'base' read-only
> again, eventually making 'block-commit' fail.
>
> This needs to be fixed in bdrv_reopen(), but until we get to that it
> can be worked around simply by swapping the order of base and
> overlay_bs in the reopen queue.
>
> In order to reproduce this bug, overlay_bs needs to be initially in
> read-only mode. That is: the 'top' parameter of 'block-commit' cannot
> be the active layer nor its immediate backing chain.
>
> Signed-off-by: Alberto Garcia <address@hidden>
> ---
> block/commit.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Max Reitz <address@hidden>
signature.asc
Description: OpenPGP digital signature