Unverified Commit f8c40ffa by LiFeng Committed by Christian Brauner

cgfsng: do MS_REMOUNT

Perform MS_REMOUNT on mounts with MS_RDONLY. Signed-off-by: 's avatarLiFeng <lifeng68@huawei.com> Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 3fb8253d
......@@ -1947,6 +1947,15 @@ static int do_secondstage_mounts_if_needed(int type, struct hierarchy *h,
cgpath);
return -1;
}
if (flags & MS_RDONLY) {
if (mount(sourcepath, cgpath, "cgroup", MS_REMOUNT | flags | MS_RDONLY, NULL) < 0) {
free(sourcepath);
SYSERROR("Error remounting %s read-only", cgpath);
return -1;
}
}
free(sourcepath);
INFO("Completed second stage cgroup automounts for %s", cgpath);
return 0;
......
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