[CRIU] [PATCH 2/4] mount: restore a shared group for propagated mounts

Andrey Vagin avagin at openvz.org
Wed Mar 2 23:00:13 PST 2016


From: Andrew Vagin <avagin at virtuozzo.com>

When a mount is propagated, the result mount is always shared.
If we want to get a private mount, we need to convert it.

https://jira.sw.ru/browse/PSBM-44354

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

diff --git a/criu/mount.c b/criu/mount.c
index b32f847..ffafcf3 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -2155,6 +2155,14 @@ static int propagate_mount(struct mount_info *mi)
 		list_for_each_entry(c, &t->children, siblings) {
 			if (mounts_equal(mi, c)) {
 				pr_debug("\t\tPropagate %s\n", c->mountpoint);
+
+				/*
+				 * When a mount is propagated, the result mount
+				 * is always shared. If we want to get a private
+				 * mount, we need to convert it.
+				 */
+				restore_shared_options(c, !c->shared_id, 0, 0);
+
 				c->mounted = true;
 				propagate_siblings(c);
 				umount_from_slaves(c);
-- 
2.5.0



More information about the CRIU mailing list