Commit 2be8b150 authored by Pavel Emelyanov's avatar Pavel Emelyanov

mount: Move cgroup checks into callback

travis-ci: success for mount: Sanitize sb comparison code
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent da60bf30
...@@ -574,6 +574,17 @@ static int tracefs_parse(struct mount_info *pm) ...@@ -574,6 +574,17 @@ static int tracefs_parse(struct mount_info *pm)
return 1; return 1;
} }
static bool cgroup_sb_equal(struct mount_info *a, struct mount_info *b)
{
if (a->private && b->private &&
strcmp(a->private, b->private))
return false;
if (strcmp(a->options, b->options))
return false;
return true;
}
static int cgroup_parse(struct mount_info *pm) static int cgroup_parse(struct mount_info *pm)
{ {
if (!(root_ns_mask & CLONE_NEWCGROUP)) if (!(root_ns_mask & CLONE_NEWCGROUP))
...@@ -720,6 +731,7 @@ static struct fstype fstypes[] = { ...@@ -720,6 +731,7 @@ static struct fstype fstypes[] = {
.name = "cgroup", .name = "cgroup",
.code = FSTYPE__CGROUP, .code = FSTYPE__CGROUP,
.parse = cgroup_parse, .parse = cgroup_parse,
.sb_equal = cgroup_sb_equal,
}, { }, {
.name = "aufs", .name = "aufs",
.code = FSTYPE__AUFS, .code = FSTYPE__AUFS,
......
...@@ -306,11 +306,6 @@ static bool mounts_sb_equal(struct mount_info *a, struct mount_info *b) ...@@ -306,11 +306,6 @@ static bool mounts_sb_equal(struct mount_info *a, struct mount_info *b)
if (strcmp(a->options, b->options)) if (strcmp(a->options, b->options))
return false; return false;
if (a->fstype->code == FSTYPE__CGROUP &&
a->private && b->private &&
strcmp(a->private, b->private))
return false;
return true; return true;
} }
......
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