From 7b968ceeab2ef8376c9a560e223accc954119bbf Mon Sep 17 00:00:00 2001 From: Pavel Tikhomirov Date: Fri, 29 May 2020 14:34:03 +0300 Subject: [PATCH] mount: use ns_mountpoint in collect_mntinfo At this point ns_mountpoint is equal to mountpoint. More over let's use robust is_same_path helper in should_skip_mount so that we don't need to rely on ->mountpoint + 1 hacks. Cherry-picked from Virtuozzo criu: https://src.openvz.org/projects/OVZ/repos/criu/commits/d4c4271a0 Changes: use is_same_path helper. Signed-off-by: Pavel Tikhomirov --- criu/proc_parse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/criu/proc_parse.c b/criu/proc_parse.c index 7955d50a6..1ec051e6a 100644 --- a/criu/proc_parse.c +++ b/criu/proc_parse.c @@ -1486,12 +1486,12 @@ bool add_skip_mount(const char *mountpoint) return true; } -static bool should_skip_mount(const char *mountpoint) +static bool should_skip_mount(char *mountpoint) { struct str_node *pos; list_for_each_entry(pos, &skip_mount_list, node) { - if (strcmp(mountpoint, pos->string) == 0) + if (is_same_path(mountpoint, pos->string)) return true; } @@ -1620,8 +1620,8 @@ struct mount_info *parse_mountinfo(pid_t pid, struct ns_id *nsid, bool for_dump) * fail loudly at "dump" stage if an opened file or another mnt * depends on this one. */ - if (for_dump && should_skip_mount(new->mountpoint + 1)) { - pr_info("\tskip %s @ %s\n", fsname, new->mountpoint); + if (for_dump && should_skip_mount(new->ns_mountpoint)) { + pr_info("\tskip %s @ %s\n", fsname, new->ns_mountpoint); mnt_entry_free(new); new = NULL; goto end;