hasmntopt() returns start of the matching string, i.e. when looking for
'cpuacct' option it can return 'cpuacct,cpuset' if these two are mounted
together. So, don't use result of this function, use internal table of
controllers instead when checking for duplicates.
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Acked-by: Ivana Hutarova Varekova<varekova@redhat.com>
/* do not have duplicates in mount table */
duplicate = 0;
for (j = 0; j < found_mnt; j++) {
- if (strncmp(mntopt, cg_mount_table[j].name,
+ if (strncmp(controllers[i],
+ cg_mount_table[j].name,
FILENAME_MAX) == 0) {
duplicate = 1;
break;