[CRIU] [PATCH] mount: master_id should be 0 for new mounts
Andrey Vagin
avagin at openvz.org
Thu Mar 10 06:48:47 PST 2016
From: Andrew Vagin <avagin at virtuozzo.com>
v2: add a comment before calling BUG_ON(mi->master_id)
Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
criu/mount.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/criu/mount.c b/criu/mount.c
index d1b61ef..df4e1f5 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -2259,9 +2259,12 @@ static int do_new_mount(struct mount_info *mi)
return -1;
}
- if (restore_shared_options(mi, !mi->shared_id && !mi->master_id,
- mi->shared_id,
- mi->master_id))
+ /*
+ * A slave should be mounted from do_bind_mount().
+ * Look at can_mount_now() for details.
+ */
+ BUG_ON(mi->master_id);
+ if (restore_shared_options(mi, !mi->shared_id, mi->shared_id, 0))
return -1;
mi->mounted = true;
--
2.5.0
More information about the CRIU
mailing list