[CRIU] [PATCH 2/2 v2] mount: handle a case when parent and child mounts in the same directory
Andrey Vagin
avagin at openvz.org
Thu May 5 07:21:21 PDT 2016
From: Andrew Vagin <avagin at virtuozzo.com>
if mountpoints of ct and t are equal we can't build absolute path
in ct_mpnt_rpath, so let's skip the first "/" in m_root_rpath
v2: add a comment
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 a3c830f..13d3603 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -635,6 +635,14 @@ static int validate_shared(struct mount_info *m)
ct_mpnt_rpath = ct->mountpoint + t_mpnt_l; /* path from t->mountpoint to ct->mountpoint */
/*
+ * if mountpoints of ct and t are equal we can't build
+ * absolute path in ct_mpnt_rpath, so let's skip the first "/"
+ * in m_root_rpath
+ */
+ if (ct_mpnt_rpath[0] == 0)
+ m_root_rpath++;
+
+ /*
* Check whether ct can be is visible at m, i.e. the
* ct's rpath starts (as path) with m's rpath.
*/
--
2.7.4
More information about the CRIU
mailing list