autofs: restore stage introduced
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:Stanislav Kinsburskiy <skinsbursky@virtuozzo.com> Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com>
Showing
This diff is collapsed.
Please
register
or
sign in
to comment