[CRIU] overmount confusion

Pavel Emelyanov xemul at parallels.com
Wed Apr 1 13:31:10 PDT 2015


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

>>> It does seem nicer to do
>>> *at() everywhere. Do we need a mount/bind-at system call if we mount
>>> things in the right order (but do an open(O_DIR) before mounting
>>> things on top of it, as you suggested above)?
>>
>> Almost. If we have / mountpoint and /foo mountpoint and want to a do something
>> with the /foo/bar file which is not on /foo's fs, but the fs that used to be
>> on / before we mounted /foo, then we need fd pointing to /foo _before_ mounting
>> on it to openat() on it (and effectively dive under /foo fs). Having fs on
>> /foo's fs root (i.e. -- /foo after mountpoint was created) wouldn't help much :)
> 
> Ah, I see. Can we solve this by just keeping a dirfd for each of the
> directories under where we mount them in case we want to use them?

Yes, exactly :) And when trying to resolve path we will need to find
which of these dirfds should we use for the *at() system call.

-- Pavel


More information about the CRIU mailing list