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

mount: add a comment to explain why do we need a clean mount

It's required when a target path is overmounted by one of child mounts.
Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 7bd2270f
...@@ -2528,6 +2528,10 @@ static int do_bind_mount(struct mount_info *mi) ...@@ -2528,6 +2528,10 @@ static int do_bind_mount(struct mount_info *mi)
if (cut_root[0] == 0) /* This case is handled by mi->bind->fd */ if (cut_root[0] == 0) /* This case is handled by mi->bind->fd */
goto skip_overmount_check; goto skip_overmount_check;
/*
* The target path may be over-mounted by one of child mounts
* and we need to create a new bind-mount to get access to the path.
*/
mp_len = strlen(mi->bind->mountpoint); mp_len = strlen(mi->bind->mountpoint);
if (mp_len > 1) /* skip a joining / if mi->bind->mountpoint isn't "/" */ if (mp_len > 1) /* skip a joining / if mi->bind->mountpoint isn't "/" */
mp_len++; mp_len++;
......
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