[CRIU] [PATCH 2/2] sk-unix: Fix path resolving for sockets with abs symlinks in paths
Cyrill Gorcunov
gorcunov at virtuozzo.com
Wed Jun 8 00:22:24 PDT 2016
On Wed, Jun 08, 2016 at 12:03:43AM -0700, Andrey Vagin wrote:
> Actually we need to fix the same problem not only for unix sockets.
>
> We need to check all places where we work with mntns_root.
Yes, I said so in the cover message.
> >
> > + if (cr_set_root(mntns_root, &root_fd))
> > + goto err;
> > +
> > snprintf(path, sizeof(path), ".%s/%s", dir, sk->name);
> > - if (fstatat(mntns_root, path, &st, 0)) {
> > - if (errno == ENOENT)
> > + ret = fstatat(mntns_root, path, &st, 0);
> > + errno_save = errno;
> > + if (cr_restore_root(root_fd))
> > + goto err;
>
> I was talking with Pavel about this problem and we decided to not
> restore root each time. We can do it only when it's requred. In this
> case the overhead will be much smaller.
How can we figure out if we don't need to use this helper?
Cyrill
More information about the CRIU
mailing list