diff --git a/fsnotify.c b/fsnotify.c index b8f9c227d..adeaa7f2e 100644 --- a/fsnotify.c +++ b/fsnotify.c @@ -534,9 +534,9 @@ static int restore_one_fanotify(int fd, struct fsnotify_mark_info *mark) mntns_root = mntns_get_root_fd(m->nsid); - target = openat(mntns_root, m->mountpoint, O_PATH); + target = openat(mntns_root, m->ns_mountpoint, O_PATH); if (target == -1) { - pr_perror("Unable to open %s", m->mountpoint); + pr_perror("Unable to open %s", m->ns_mountpoint); goto err; } diff --git a/mount.c b/mount.c index ab74b6bc5..37ed0a830 100644 --- a/mount.c +++ b/mount.c @@ -995,23 +995,23 @@ static int __open_mountpoint(struct mount_info *pm, int mnt_fd) if (mntns_root < 0) return -1; - mnt_fd = openat(mntns_root, pm->mountpoint, O_RDONLY); + mnt_fd = openat(mntns_root, pm->ns_mountpoint, O_RDONLY); if (mnt_fd < 0) { - pr_perror("Can't open %s", pm->mountpoint); + pr_perror("Can't open %s", pm->ns_mountpoint); return -1; } } ret = fstat(mnt_fd, &st); if (ret < 0) { - pr_perror("fstat(%s) failed", pm->mountpoint); + pr_perror("fstat(%s) failed", pm->ns_mountpoint); goto err; } - dev = phys_stat_resolve_dev(pm->nsid, st.st_dev, pm->mountpoint + 1); + dev = phys_stat_resolve_dev(pm->nsid, st.st_dev, pm->ns_mountpoint + 1); if (dev != pm->s_dev) { pr_err("The file system %#x (%#x) %s %s is inaccessible\n", - pm->s_dev, (int)dev, pm->fstype->name, pm->mountpoint); + pm->s_dev, (int)dev, pm->fstype->name, pm->ns_mountpoint); goto err; } diff --git a/proc_parse.c b/proc_parse.c index cf70a92d0..515785382 100644 --- a/proc_parse.c +++ b/proc_parse.c @@ -1017,6 +1017,7 @@ static int parse_mountinfo_ent(char *str, struct mount_info *new, char **fsname) new->mountpoint = xmalloc(PATH_MAX); if (new->mountpoint == NULL) goto err; + new->ns_mountpoint = new->mountpoint; new->mountpoint[0] = '.'; ret = sscanf(str, "%i %i %u:%u %ms %s %ms %n",