Skip to content

Commit

Permalink
mount: handle a case when parent and child mounts in the same directory
Browse files Browse the repository at this point in the history
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@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
  • Loading branch information
avagin authored and xemul committed May 6, 2016
1 parent d923184 commit b8758b9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions criu/mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,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.
Expand Down

0 comments on commit b8758b9

Please sign in to comment.