On 03.06.2016 08:32, Fam Zheng wrote: > On Tue, 05/24 20:20, Max Reitz wrote: >> On 17.05.2016 09:35, Fam Zheng wrote: >>> In sync=none the backing image of s->target is s->common.bs, which could >>> be exclusively locked, the image locking wouldn't work here. >> >> Why is the backing image s->common.bs when the bdrv_open() call >> explicitly specifies BDRV_O_NO_BACKING? > > BDRV_O_NO_BACKING is cleared in mirror_complete where the backing image is > opened, we cannot use lock there as the backing is already open rw as source.
Oh, yes, of course you're right. OK, then, if patch 7 of this series worked correctly, the bdrv_reopen() in mirror_exit() would copy the locking status from the source BDS to the target, effectively again overriding the disabled locking as it has been set here. I think the real issue is that mirror_complete() opens a completely new backing chain, when it could just reuse the existing backing chain of the source BDS. Unless you want to do that yourself, I guess I can take a look into that, as this is very much related to my "block/mirror: Fix target backing BDS" series. Max
signature.asc
Description: OpenPGP digital signature