[CRIU] [PATCH v7 11/15] mount: copy private field to "bind mount" mount_info structure

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Mon Mar 14 07:59:36 PDT 2016


Mount private field can be initialized on actual mount operation, and then
used later with a bind-mount.
Thus, if have to be copied.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 criu/mount.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/criu/mount.c b/criu/mount.c
index ea5aae7..51af24a 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -2368,6 +2368,13 @@ static int do_bind_mount(struct mount_info *mi)
 	private = !mi->master_id && !shared;
 	cut_root = cut_root_for_bind(mi->root, mi->bind->root);
 
+	/* Mount private can be initialized on mount() callback, which is
+	 * called only once.
+	 * It have to be copied to all it's sibling structures to provide users
+	 * of it with actual data.
+	 */
+	mi->private = mi->bind->private;
+
 	if (list_empty(&mi->bind->children))
 		mnt_path = mi->bind->mountpoint;
 	else {



More information about the CRIU mailing list