[CRIU] [PATCH 4/4] mount: open_mount uses __open_mountpoint instead of own logic

Andrew Vagin avagin at parallels.com
Wed Apr 16 01:13:56 PDT 2014


On Wed, Apr 16, 2014 at 11:59:15AM +0400, Pavel Emelyanov wrote:
> On 04/16/2014 11:15 AM, Andrey Wagin wrote:
> > 2014-04-16 10:35 GMT+04:00 Pavel Emelyanov <xemul at parallels.com>:
> >> On 04/16/2014 09:04 AM, Andrey Vagin wrote:
> >>
> >>> @@ -488,7 +476,8 @@ static int __open_mountpoint(struct mount_info *pm, int mnt_fd)
> >>>
> >>>               mntns_root = get_service_fd(ROOT_FD_OFF);
> >>>
> >>> -             snprintf(path, sizeof(path), ".%s", pm->mountpoint);
> >>> +             /* paths starts from "." on restore and "/" on dump */
> >>
> >> Can you be more descriptive here, please?
> > 
> > I don't know what to write here
> > openat(fd, "/") will ignore fd
> > openat(fd, ".asdf") and openat(fd, "./asdf") are not the same
> 
> Why are we converting paths from .foo into ./foo in this hunk? What
> are we trying to "fix"?

open_mount is used on restore, open_mountpoint is used on dump.

So after this patch we start use __open_mountpoint on restore, where
paths are in another "format".

> 
> >>
> >>> +             snprintf(path, sizeof(path), "./%s", pm->mountpoint);
> >>>               mnt_fd = openat(mntns_root, path, O_RDONLY);
> >>>               if (mnt_fd < 0) {
> >>>                       pr_perror("Can't open %s", pm->mountpoint);
> >>>
> >>
> >>
> > .
> > 
> 
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list