[CRIU] [PATCH 27/39] mounts: mntns_collect_root in __open_mountpoint

Andrey Vagin avagin at openvz.org
Mon Apr 21 07:23:37 PDT 2014


We are going to support nested mount namespaces,
file descriptors can be from different namespaces,
so a namespace root must be updated for each of them.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 mount.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mount.c b/mount.c
index f90f63f..845f8a6 100644
--- a/mount.c
+++ b/mount.c
@@ -491,7 +491,9 @@ static int __open_mountpoint(struct mount_info *pm, int mnt_fd)
 	if (mnt_fd == -1) {
 		int mntns_root;
 
-		mntns_root = get_service_fd(ROOT_FD_OFF);
+		mntns_root = mntns_collect_root(pm->nsid->pid);
+		if (mntns_root < 0)
+			return -1;
 
 		mnt_fd = openat(mntns_root, pm->mountpoint, O_RDONLY);
 		if (mnt_fd < 0) {
-- 
1.8.5.3



More information about the CRIU mailing list