[CRIU] [PATCH 2/2] mount: create a clean mount only if a sub directory is bind-mounted

Andrey Vagin avagin at openvz.org
Tue May 10 17:38:38 PDT 2016


From: Andrei Vagin <avagin at virtuozzo.com>

A clean mount is not required when a mount point is bind-mounted.

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

diff --git a/criu/mount.c b/criu/mount.c
index 6896aa4..052d62a 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -2476,7 +2476,7 @@ static int do_bind_mount(struct mount_info *mi)
 		mnt_path = mnt_fd_path;
 	}
 
-	if (!list_empty(&mi->bind->children)) {
+	if (!list_empty(&mi->bind->children) && cut_root[0] != 0) {
 		/* mi->bind->mountpoint may be overmounted */
 		if (mount(mnt_path, mnt_clean_path, NULL, MS_BIND, NULL)) {
 			pr_perror("Unable to bind-mount %s to %s",
-- 
2.7.4



More information about the CRIU mailing list