[PATCH 7/9] migration: don't remember image labels when migrating with shared fs

Peng Liang liangpeng10 at huawei.com
Thu Sep 9 11:32:09 UTC 2021


On 9/9/2021 7:01 PM, Michal Prívozník wrote:
> On 8/23/21 4:41 AM, Peng Liang wrote:
>> When migrating with shared fs, the image labels has been remembered and
>> the ownership of the image has been set in the src host.  If the dst
>> host remembers the ownership of the image again, the ownership of the
>> image remembered in the src host (the origin ownership) will lost.
>>
>> Signed-off-by: Peng Liang <liangpeng10 at huawei.com>
>> ---
>>  src/security/security_dac.c | 32 +++++++++++++++++++++++---------
>>  1 file changed, 23 insertions(+), 9 deletions(-)
>>
> 
> 
> I thought that refcounting should do the trick here. At least that was
> my intent when implementing this feature. I mean, the source sets
> seclabels and since the domain runs just once all refcounters are equal
> to 1. Then, during migration when the destination sets labels the
> refcounter is (temporarily) increased to 2, but only until the source
> calls restore (in which case the refcounter is decreased back to 1 again).
> 
> Are you seeing different behaviour?

When the dst try to remember the labels (in
virSecuritySetRememberedLabel), it will find that the timestamp is
invalid, then it will remove all labels and set a new one instead of
increasing the refcounter to 2.  So I add
virSecurityManagerUpdateImageLabel to update labels (currently, only
update timestamp) during migration.

> 
> BTW: what FS are you using to test this? Because I'm not aware of any
> shared FS that would support XATTRs.

We are testing using ocfs2.

Thanks,
Peng

> 
> Michal
> 
> .
> 






More information about the libvir-list mailing list