View | Details | Raw Unified | Return to ticket 16713 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/plugins/cgroup/v2/cgroup_v2.c (-3 / +19 lines)
Lines 102-107 extern bool cgroup_p_has_feature(cgroup_ctl_feature_t f); Link Here
102
extern int cgroup_p_task_addto(cgroup_ctl_type_t ctl, stepd_step_rec_t *step,
102
extern int cgroup_p_task_addto(cgroup_ctl_type_t ctl, stepd_step_rec_t *step,
103
			       pid_t pid, uint32_t task_id);
103
			       pid_t pid, uint32_t task_id);
104
104
105
/*
106
 * Remove the "../" from a path.
107
 */
108
static char *_remove_dot_dot_slash(char *p)
109
{
110
	while (*p != '\0') {
111
		if ((*p == '/') && (*(p + 1) == '.') && (*(p + 2) == '.'))
112
			p = p + 3;
113
		else
114
			break;
115
	}
116
	return p;
117
}
118
105
/* Hierarchy will take this form:
119
/* Hierarchy will take this form:
106
 *        [int_cg_ns]             [int_cg_ns]
120
 *        [int_cg_ns]             [int_cg_ns]
107
 *      "slurmd service"       "slurmtepds scope"
121
 *      "slurmd service"       "slurmtepds scope"
Lines 158-163 static char *_get_self_cg_path() Link Here
158
	if (start && (*start != '\0')) {
172
	if (start && (*start != '\0')) {
159
		if ((p = xstrchr(start, '\n')))
173
		if ((p = xstrchr(start, '\n')))
160
			*p = '\0';
174
			*p = '\0';
175
		start = _remove_dot_dot_slash(start);
161
		xstrfmtcat(ret, "%s%s",
176
		xstrfmtcat(ret, "%s%s",
162
			   slurm_cgroup_conf.cgroup_mountpoint, start);
177
			   slurm_cgroup_conf.cgroup_mountpoint, start);
163
	}
178
	}
Lines 214-222 static char *_get_init_cg_path() Link Here
214
		if (!xstrcmp(p, "/"))
229
		if (!xstrcmp(p, "/"))
215
			xstrfmtcat(ret, "%s",
230
			xstrfmtcat(ret, "%s",
216
				   slurm_cgroup_conf.cgroup_mountpoint);
231
				   slurm_cgroup_conf.cgroup_mountpoint);
217
		else
232
		else {
233
			start = _remove_dot_dot_slash(p);
218
			xstrfmtcat(ret, "%s%s",
234
			xstrfmtcat(ret, "%s%s",
219
				   slurm_cgroup_conf.cgroup_mountpoint, p);
235
				   slurm_cgroup_conf.cgroup_mountpoint, start);
236
		}
220
		xfree(p);
237
		xfree(p);
221
	}
238
	}
222
	xfree(buf);
239
	xfree(buf);
223
- 

Return to ticket 16713