• Stanislav Kinsburskiy's avatar
    autofs: restore stage introduced · dca4f4f2
    Stanislav Kinsburskiy authored
    AutoFS mount point is managed by user space daemon, which receives requests
    from kernel via pipe, passed on mount operation.
    Kernel hold write end, while user space process - read end.
    Thus, for successfull AutoFS migration, this connection has to be restored.
    
    Autofs restore is tricky. Mount point is created by init process in pair with
    per-mount context to be able to fix up actual kernel-userspace pipe
    connection, when all the mount points are restored.
    
    The problems with restoring pipe connection are:
    
    1) It has to be done from actual AutoFS mount point master process context,
    because pipe and pgrp values are taken from current in kernel.
    2) Actual mounts are created by "init" process, and mount point owner (master)
    have to set later.
    3) To update mount point master one requires an opened write end of the pipe.
    
    To provide AutoFS mount point master with resources, mentioned above, the
    following was implemented:
    
    1) If mount master doesn't have write pipe end opened, it is created as a
    clone of read pipe end file descriptor and added to master's fds list. This
    end is required to reconfigure mount point master.
    2) Another pipe fle is created with explicit "post_open" callback, which is
    used for actual mount point reconfiguration.
    3) Mount point in created by init process. Mount data, required to restore
    the owner, is copied to shared memory location by post-mount callback.
    Signed-off-by: 's avatarStanislav Kinsburskiy <skinsbursky@virtuozzo.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    dca4f4f2
Name
Last commit
Last update
Documentation Loading commit data...
contrib Loading commit data...
coredump Loading commit data...
crit Loading commit data...
criu Loading commit data...
images Loading commit data...
lib Loading commit data...
scripts Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
INSTALL.md Loading commit data...
Makefile Loading commit data...
Makefile.install Loading commit data...
Makefile.versions Loading commit data...
README.md Loading commit data...