[CRIU] Sync TODO-s for mount.c work

Pavel Emelyanov xemul at parallels.com
Thu Apr 23 10:17:29 PDT 2015


On 04/23/2015 08:01 PM, Tycho Andersen wrote:

>> E.g. the proc one. So if we have
>> proc privately inherited from host and proc privately mounted inside then
>> my checks will classify both as "private". While the former one should be
>> bind-mounted and the latter one should be just mounted. So we also need to
>> compare the super blocks, i.e. the devices. %)
>>
>> So...
>>
>> int is_not_external()
>> {
>>        if (master_is_external())
>>              return false;
>>
>>        if (root_is_accessible())
>>              return true;
>>
>>        return false;
>> }
>>
>> where root_is_accessible() should also care for the superblocks, i.e.
>>
>> int root_is_accessible()
>> {
>>        if (device_is_visible())
>>              return true;
>>
>>        if (root_path_is_visible())
> 
> The problem is that the root path can be / (which really means "the
> external /"), but we think it is visible since it's visible from the
> internal / as well.

Now -- yes. But I propose to mess with super-blocks, i.e. device-ids -- if the
device we want to mount is "ours" then we can treat the mountpoint as internal,
if it sits outside of our scope -- then the mountpoint is external regardless
of what the root path is.

For example ext4-s will always be internally visible, as we can always mount
any /dev/xxx device we need. At least try to. Pstores are always internal, as
they are not (yet) virtualized. ProcFS is more complex, if the proc mount sb
we want to mount will be given to us by plain mount() then it's internal,
otherwise it's external. And all this is regardless of the mp->root path.

-- Pavel


More information about the CRIU mailing list