[CRIU] [PATCH] mount: add a comment to explain why do we need a clean mount

Andrey Vagin avagin at openvz.org
Thu May 19 14:08:30 PDT 2016


From: Andrew Vagin <avagin at virtuozzo.com>

It's required when a target path is overmounted by one of child mounts.

Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 criu/mount.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/criu/mount.c b/criu/mount.c
index 6f47655..87c2791 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -2514,6 +2514,10 @@ static int do_bind_mount(struct mount_info *mi)
 	if (cut_root[0] == 0) /* This case is handled by mi->bind->fd */
 		goto skip_overmount_check;
 
+	/*
+	 * The target path may be over-mounted by one of child mounts
+	 * and we need to create a new bind-mount to get access to the path.
+	 */
 	mp_len = strlen(mi->bind->mountpoint);
 	if (mp_len > 1) /* skip a joining / if mi->bind->mountpoint isn't "/" */
 		mp_len++;
-- 
2.7.4



More information about the CRIU mailing list