[4/6] mnt: pass a mount point patch to get_mp_mountpoint

Submitted by Andrei Vagin on Sept. 13, 2016, 4:19 a.m.

Details

Message ID 1473740388-3797-5-git-send-email-avagin@openvz.org
State Accepted
Series "mnt: try to split a mount tree to restore over-mounted mounts"
Commit afda6f54ca304c008126469af5fe589c2a0c9f40
Headers show

Commit Message

Andrei Vagin Sept. 13, 2016, 4:19 a.m.
From: Andrei Vagin <avagin@virtuozzo.com>

It will be used in next patches

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

Patch hide | download patch | download mbox

diff --git a/criu/mount.c b/criu/mount.c
index 78448c7..e568249 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -2934,11 +2934,11 @@  out:
 	return 0;
 }
 
-static int get_mp_mountpoint(MntEntry *me, struct mount_info *mi, char *root, int root_len)
+static int get_mp_mountpoint(char *mountpoint, struct mount_info *mi, char *root, int root_len)
 {
 	int len;
 
-	len  = strlen(me->mountpoint) + root_len + 1;
+	len  = strlen(mountpoint) + root_len + 1;
 	mi->mountpoint = xmalloc(len);
 	if (!mi->mountpoint)
 		return -1;
@@ -2951,7 +2951,7 @@  static int get_mp_mountpoint(MntEntry *me, struct mount_info *mi, char *root, in
 	 */
 
 	strcpy(mi->mountpoint, root);
-	strcpy(mi->mountpoint + root_len, me->mountpoint);
+	strcpy(mi->mountpoint + root_len, mountpoint);
 
 	mi->ns_mountpoint = mi->mountpoint + root_len;
 
@@ -3043,7 +3043,7 @@  static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid)
 		if (get_mp_root(me, pm))
 			goto err;
 
-		if (get_mp_mountpoint(me, pm, root, root_len))
+		if (get_mp_mountpoint(me->mountpoint, pm, root, root_len))
 			goto err;
 
 		pr_debug("\tRead %d mp @ %s\n", pm->mnt_id, pm->mountpoint);

Comments

Pavel Emelianov Sept. 21, 2016, 7:21 a.m.
Applied