• Tycho Andersen's avatar
    cgroup: actually detect cgroupns bind mounts correctly · a4b48a2d
    Tycho Andersen authored
    Initially, the cgroupns patchset that went into the Ubuntu kernels had the
    nsroot= argument in mountopts, which allowed us to distinguish between
    cgroupfs mounts. The upstream kernel doesn't have this (the reasoning was
    that it showed up in the root field of mountinfo), so all cgroup mounts
    look idential if we don't consider the root mount, and we wrongly detect
    the mounts as bind mounts. Instead, let's remember the root path and
    compare this when considering when a mount is a bind mount.
    
    This patch is a little ugly because it intorduces cgroup specific behavior
    into the generic code, which we've thus far been able to avoid. One way to
    deal with this might be able to add a ->sb_equal hook to the fstype struct
    that could compare mountinfos' superblocks, and then fall back to
    mounts_sb_equal if that isn't present. Or we can leave this specific code
    in the generic bits until more of these appear. Either way is fine with me.
    
    v2: move the cgroup specific code to mounts_sb_equal()
    Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    a4b48a2d
Name
Last commit
Last update
Documentation Loading commit data...
contrib Loading commit data...
coredump Loading commit data...
crit Loading commit data...
criu Loading commit data...
images Loading commit data...
lib Loading commit data...
scripts Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
INSTALL.md Loading commit data...
Makefile Loading commit data...
Makefile.install Loading commit data...
Makefile.versions Loading commit data...
README.md Loading commit data...