[CRIU] [PATCH] Add checkpoint/restore for /proc/pid/exe symlink
Cyrill Gorcunov
gorcunov at openvz.org
Mon Feb 6 11:29:53 EST 2012
On Mon, Feb 06, 2012 at 08:08:29PM +0400, Stanislav Kinsbursky wrote:
> 06.02.2012 19:41, Cyrill Gorcunov пишет:
> >This patch adds ability to checkpoint/restore
> >/proc/pid/exe symlink, so if a process we've just
> >checkpointed has been say /path/to/exe, then at restore
> >time we bring this path back.
> >
> >A few notes
> >
> > - If the file which symlink we're about to restore
> > has been deleted after checkpoint procedure and
> > no longer exist -- we print error message but do
> > not interrupt restore procedure because it's not
> > that critical
> >
>
> 1 of all: sorry for probably dummy questions.
>
> We do not migrate unlinked files yet? Or we don't even check, that
> this file is unlinked?
For this particular case -- the presence of file exe point to is
tested by the kernel itself, ie we rather don't care which path
is passed. Is that what you mean in question?
>
> > - Also there some restiction from kernel side: if
> > existing /proc/pid/exe already mapped more than
> > once, the kernel will refuse to change the symlink,
> > so we need to restore it lately when mmaps of crtools
> > itself already unmapped (ie via late call in
> > restorer.c).
>
> Why do we need change this symlink at all?
Otherwise we will have the link to crtools here, since it's
crtools who is executed and forked then. The potential problem
here is that the kernel have no idea about Elf structure once
elf loaded and running, the kernel operates with VMAs and I
fear it's possible that this exe link might be used by loader
on lazy load of .so files *BUT* I didn't checked if it's true.
And after all, Stas, it was you how were complaining about
wrong /proc/pid/exe after restore? :)
>
> >
> >In any case -- we don't treat inability to restore
> >/proc/pid/exe symlink as a critical error.
> >
>
> Is this proc symlink tied with exe vma restoration? IOW, we have to
> restore vma for task binary, don't we? And in this case, what is the
> problem to restore /proc/pid/exe always?
>
I don't follow. You mean why do we restrict that exe will be restored
iif it's not mapped several times in kernel already?
Cyrill
More information about the CRIU
mailing list