On Tue 12 Feb 2019 03:47:47 PM CET, Kevin Wolf wrote:
> Am 17.01.2019 um 16:33 hat Alberto Garcia geschrieben:
>> @@ -3861,6 +3923,10 @@ int bdrv_drop_intermediate(BlockDriverState *top, 
>> BlockDriverState *base,
>>          goto exit;
>>      }
>>  
>> +    if (bdrv_is_backing_chain_frozen(top, base, NULL)) {
>> +        goto exit;
>> +    }
>> +
>>      /* If 'base' recursively inherits from 'top' then we should set
>>       * base->inherits_from to top->inherits_from after 'top' and all
>>       * other intermediate nodes have been dropped.
>
> bdrv_drop_intermediate() doesn't change the links between in the chain
> between top and base, but the links between the parents of top and top
> are changed to point to base instead.
>
> I think this is checking the wrong thing.

You're right, those links should be checked.

On the other hand it does remove all references from top's parents to
top, so in the general case it will end up deleting all intermediate
notes, and their backing links with them. So I think we still need that
check.

Berto

Reply via email to