Skip to content

Commit 91afe60

Browse files
committed
Merge branch 'for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup updates from Tejun Heo: "These three patches were scheduled for the merge window but I forgot to send them out. Sorry about that. None of them are significant and they fit well in a fix pull request too - two are cosmetic and one fixes a memory leak in the mount option parsing path" * 'for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup: Fix memory leak when parsing multiple source parameters cgroup/cgroup.c: replace 'of->kn->priv' with of_cft() kernel: cgroup: Mundane spelling fixes throughout the file
2 parents 5c8fe58 + 2d18e54 commit 91afe60

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

kernel/cgroup/cgroup-v1.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,8 @@ int cgroup1_parse_param(struct fs_context *fc, struct fs_parameter *param)
908908
opt = fs_parse(fc, cgroup1_fs_parameters, param, &result);
909909
if (opt == -ENOPARAM) {
910910
if (strcmp(param->key, "source") == 0) {
911+
if (fc->source)
912+
return invalf(fc, "Multiple sources not supported");
911913
fc->source = param->string;
912914
param->string = NULL;
913915
return 0;

kernel/cgroup/cgroup.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ bool cgroup_ssid_enabled(int ssid)
244244
*
245245
* The default hierarchy is the v2 interface of cgroup and this function
246246
* can be used to test whether a cgroup is on the default hierarchy for
247-
* cases where a subsystem should behave differnetly depending on the
247+
* cases where a subsystem should behave differently depending on the
248248
* interface version.
249249
*
250250
* List of changed behaviors:
@@ -262,7 +262,7 @@ bool cgroup_ssid_enabled(int ssid)
262262
* "cgroup.procs" instead.
263263
*
264264
* - "cgroup.procs" is not sorted. pids will be unique unless they got
265-
* recycled inbetween reads.
265+
* recycled in-between reads.
266266
*
267267
* - "release_agent" and "notify_on_release" are removed. Replacement
268268
* notification mechanism will be implemented.
@@ -342,7 +342,7 @@ static bool cgroup_is_mixable(struct cgroup *cgrp)
342342
return !cgroup_parent(cgrp);
343343
}
344344

345-
/* can @cgrp become a thread root? should always be true for a thread root */
345+
/* can @cgrp become a thread root? Should always be true for a thread root */
346346
static bool cgroup_can_be_thread_root(struct cgroup *cgrp)
347347
{
348348
/* mixables don't care */
@@ -527,7 +527,7 @@ static struct cgroup_subsys_state *cgroup_e_css_by_mask(struct cgroup *cgrp,
527527
* the root css is returned, so this function always returns a valid css.
528528
*
529529
* The returned css is not guaranteed to be online, and therefore it is the
530-
* callers responsiblity to tryget a reference for it.
530+
* callers responsibility to try get a reference for it.
531531
*/
532532
struct cgroup_subsys_state *cgroup_e_css(struct cgroup *cgrp,
533533
struct cgroup_subsys *ss)
@@ -699,7 +699,7 @@ EXPORT_SYMBOL_GPL(of_css);
699699
; \
700700
else
701701

702-
/* walk live descendants in preorder */
702+
/* walk live descendants in pre order */
703703
#define cgroup_for_each_live_descendant_pre(dsct, d_css, cgrp) \
704704
css_for_each_descendant_pre((d_css), cgroup_css((cgrp), NULL)) \
705705
if (({ lockdep_assert_held(&cgroup_mutex); \
@@ -933,7 +933,7 @@ void put_css_set_locked(struct css_set *cset)
933933

934934
WARN_ON_ONCE(!list_empty(&cset->threaded_csets));
935935

936-
/* This css_set is dead. unlink it and release cgroup and css refs */
936+
/* This css_set is dead. Unlink it and release cgroup and css refs */
937937
for_each_subsys(ss, ssid) {
938938
list_del(&cset->e_cset_node[ssid]);
939939
css_put(cset->subsys[ssid]);
@@ -1058,7 +1058,7 @@ static struct css_set *find_existing_css_set(struct css_set *old_cset,
10581058

10591059
/*
10601060
* Build the set of subsystem state objects that we want to see in the
1061-
* new css_set. while subsystems can change globally, the entries here
1061+
* new css_set. While subsystems can change globally, the entries here
10621062
* won't change, so no need for locking.
10631063
*/
10641064
for_each_subsys(ss, i) {
@@ -1148,7 +1148,7 @@ static void link_css_set(struct list_head *tmp_links, struct css_set *cset,
11481148

11491149
/*
11501150
* Always add links to the tail of the lists so that the lists are
1151-
* in choronological order.
1151+
* in chronological order.
11521152
*/
11531153
list_move_tail(&link->cset_link, &cgrp->cset_links);
11541154
list_add_tail(&link->cgrp_link, &cset->cgrp_links);
@@ -3654,7 +3654,7 @@ static ssize_t cgroup_freeze_write(struct kernfs_open_file *of,
36543654

36553655
static int cgroup_file_open(struct kernfs_open_file *of)
36563656
{
3657-
struct cftype *cft = of->kn->priv;
3657+
struct cftype *cft = of_cft(of);
36583658

36593659
if (cft->open)
36603660
return cft->open(of);
@@ -3663,7 +3663,7 @@ static int cgroup_file_open(struct kernfs_open_file *of)
36633663

36643664
static void cgroup_file_release(struct kernfs_open_file *of)
36653665
{
3666-
struct cftype *cft = of->kn->priv;
3666+
struct cftype *cft = of_cft(of);
36673667

36683668
if (cft->release)
36693669
cft->release(of);
@@ -3674,7 +3674,7 @@ static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf,
36743674
{
36753675
struct cgroup_namespace *ns = current->nsproxy->cgroup_ns;
36763676
struct cgroup *cgrp = of->kn->parent->priv;
3677-
struct cftype *cft = of->kn->priv;
3677+
struct cftype *cft = of_cft(of);
36783678
struct cgroup_subsys_state *css;
36793679
int ret;
36803680

@@ -3724,7 +3724,7 @@ static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf,
37243724

37253725
static __poll_t cgroup_file_poll(struct kernfs_open_file *of, poll_table *pt)
37263726
{
3727-
struct cftype *cft = of->kn->priv;
3727+
struct cftype *cft = of_cft(of);
37283728

37293729
if (cft->poll)
37303730
return cft->poll(of, pt);
@@ -4134,7 +4134,7 @@ struct cgroup_subsys_state *css_next_child(struct cgroup_subsys_state *pos,
41344134
* implies that if we observe !CSS_RELEASED on @pos in this RCU
41354135
* critical section, the one pointed to by its next pointer is
41364136
* guaranteed to not have finished its RCU grace period even if we
4137-
* have dropped rcu_read_lock() inbetween iterations.
4137+
* have dropped rcu_read_lock() in-between iterations.
41384138
*
41394139
* If @pos has CSS_RELEASED set, its next pointer can't be
41404140
* dereferenced; however, as each css is given a monotonically
@@ -4382,7 +4382,7 @@ static struct css_set *css_task_iter_next_css_set(struct css_task_iter *it)
43824382
}
43834383

43844384
/**
4385-
* css_task_iter_advance_css_set - advance a task itererator to the next css_set
4385+
* css_task_iter_advance_css_set - advance a task iterator to the next css_set
43864386
* @it: the iterator to advance
43874387
*
43884388
* Advance @it to the next css_set to walk.
@@ -6308,7 +6308,7 @@ struct cgroup_subsys_state *css_from_id(int id, struct cgroup_subsys *ss)
63086308
*
63096309
* Find the cgroup at @path on the default hierarchy, increment its
63106310
* reference count and return it. Returns pointer to the found cgroup on
6311-
* success, ERR_PTR(-ENOENT) if @path doens't exist and ERR_PTR(-ENOTDIR)
6311+
* success, ERR_PTR(-ENOENT) if @path doesn't exist and ERR_PTR(-ENOTDIR)
63126312
* if @path points to a non-directory.
63136313
*/
63146314
struct cgroup *cgroup_get_from_path(const char *path)

0 commit comments

Comments
 (0)