Commit f0bec213 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

mount: handle a case when parent and child mounts in the same directory

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: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent bcf40bfa
...@@ -612,6 +612,14 @@ static int validate_shared(struct mount_info *m) ...@@ -612,6 +612,14 @@ static int validate_shared(struct mount_info *m)
ct_mpnt_rpath = ct->mountpoint + t_mpnt_l; /* path from t->mountpoint to ct->mountpoint */ 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 * Check whether ct can be is visible at m, i.e. the
* ct's rpath starts (as path) with m's rpath. * ct's rpath starts (as path) with m's rpath.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment