• Li Zefan's avatar
    cgroup: fix the retry path of cgroup_mount() · e37a06f1
    Li Zefan authored
    If we hit the retry path, we'll call parse_cgroupfs_options() again,
    but the string we pass to it has been modified by the previous call
    to this function.
    
    This bug can be observed by:
    
      # mount -t cgroup -o name=foo,cpuset xxx /mnt && umount /mnt && \
        mount -t cgroup -o name=foo,cpuset xxx /mnt
      mount: wrong fs type, bad option, bad superblock on xxx,
             missing codepage or helper program, or other error
      ...
    
    The second mount passed "name=foo,cpuset" to the parser, and then it
    hit the retry path and call the parser again, but this time the string
    passed to the parser is "name=foo".
    
    To fix this, we avoid calling parse_cgroupfs_options() again in this
    case.
    Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    e37a06f1
cgroup.c 130 KB