Blob Blame History Raw
From 7fa7b4a49e5e3ff2f244ab85b41baa78d53eabb2 Mon Sep 17 00:00:00 2001
From: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Date: Tue, 30 Nov 2021 12:11:02 +0300
Subject: [PATCH 189/245] mount: use ns_mountpoint in mnt_is_overmounted

Let's use ->ns_mountpoint in comparison as ->mountpoint can change (e.g.
see how we add ns root in get_mp_mountpoint and in do_remap_mount we can
change it again). We plan to get rid of ->mountpoint everywhere where we
can use unchanged ->ns_mountpoint.

Cherry-picked hunks from Virtuozzo criu:
https://src.openvz.org/projects/OVZ/repos/criu/commits/e98e1456d

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 criu/mount.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/criu/mount.c b/criu/mount.c
index 5fdd60cda..83baef4f3 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -1322,7 +1322,7 @@ bool mnt_is_overmounted(struct mount_info *mi)
 		list_for_each_entry(t, &m->parent->children, siblings) {
 			if (m == t)
 				continue;
-			if (issubpath(m->mountpoint, t->mountpoint)) {
+			if (issubpath(m->ns_mountpoint, t->ns_mountpoint)) {
 				mi->is_overmounted = 1;
 				goto exit;
 			}
@@ -1338,7 +1338,7 @@ bool mnt_is_overmounted(struct mount_info *mi)
 
 	/* Check there is no children-overmount */
 	list_for_each_entry(c, &mi->children, siblings)
-		if (!strcmp(c->mountpoint, mi->mountpoint)) {
+		if (!strcmp(c->ns_mountpoint, mi->ns_mountpoint)) {
 			mi->is_overmounted = 1;
 			goto exit;
 		}
-- 
2.35.1