• Andrew Vagin's avatar
    mount: detect sibling mounts correctly · 308741d0
    Andrew Vagin authored
    I found the meaning of comparing basename-s for mounts in mount_qual(),
    which was removed in v2.1-49-gbcf40bfa.
    
    I think it was an attempt to detect siblings (propagated mounts).
    
    Actually it's wrong to compare only basenames for such mounts and
    we need to generate full paths for them.
    
    For example:
    28 25 0:25 /	/sys/fs/cgroup/devices rw shared:10 - cgroup cgroup rw,devices
    29 28 0:49 /	/sys/fs/cgroup/devices/101/xxx/yyy ...
    38 35 0:25 /101 /sys/fs/cgroup/devices/ rw master:10 - cgroup cgroup rw,devices
    39 38 0:49 /	/sys/fs/cgroup/devices/xxx/yyy ...
    
    28 and 38 are in the one shared group. 29 and 39 siblings and probably
    one of them was mounted and another one was propagated.
    
    This patch adds a function to generate a sibling mount point and
    use it to propagate mounts
    Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    308741d0
path.c 2.23 KB