Merge branch 'for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 28 Dec 2020 19:16:38 +0000 (11:16 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 28 Dec 2020 19:16:38 +0000 (11:16 -0800)
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

1  2 
kernel/cgroup/cgroup.c

diff --combined kernel/cgroup/cgroup.c
@@@ -199,7 -199,7 +199,7 @@@ static u16 have_canfork_callback __read
  
  /* cgroup namespace for init task */
  struct cgroup_namespace init_cgroup_ns = {
 -      .count          = REFCOUNT_INIT(2),
 +      .ns.count       = REFCOUNT_INIT(2),
        .user_ns        = &init_user_ns,
        .ns.ops         = &cgroupns_operations,
        .ns.inum        = PROC_CGROUP_INIT_INO,
@@@ -244,7 -244,7 +244,7 @@@ bool cgroup_ssid_enabled(int ssid
   *
   * The default hierarchy is the v2 interface of cgroup and this function
   * can be used to test whether a cgroup is on the default hierarchy for
-  * cases where a subsystem should behave differnetly depending on the
+  * cases where a subsystem should behave differently depending on the
   * interface version.
   *
   * List of changed behaviors:
   *   "cgroup.procs" instead.
   *
   * - "cgroup.procs" is not sorted.  pids will be unique unless they got
-  *   recycled inbetween reads.
+  *   recycled in-between reads.
   *
   * - "release_agent" and "notify_on_release" are removed.  Replacement
   *   notification mechanism will be implemented.
   * - cpuset: a task can be moved into an empty cpuset, and again it takes
   *   masks of ancestors.
   *
 - * - memcg: use_hierarchy is on by default and the cgroup file for the flag
 - *   is not created.
 - *
   * - blkcg: blk-throttle becomes properly hierarchical.
   *
   * - debug: disallowed on the default hierarchy.
@@@ -342,7 -345,7 +342,7 @@@ static bool cgroup_is_mixable(struct cg
        return !cgroup_parent(cgrp);
  }
  
- /* can @cgrp become a thread root? should always be true for a thread root */
+ /* can @cgrp become a thread root? Should always be true for a thread root */
  static bool cgroup_can_be_thread_root(struct cgroup *cgrp)
  {
        /* mixables don't care */
@@@ -527,7 -530,7 +527,7 @@@ static struct cgroup_subsys_state *cgro
   * the root css is returned, so this function always returns a valid css.
   *
   * The returned css is not guaranteed to be online, and therefore it is the
-  * callers responsiblity to tryget a reference for it.
+  * callers responsibility to try get a reference for it.
   */
  struct cgroup_subsys_state *cgroup_e_css(struct cgroup *cgrp,
                                         struct cgroup_subsys *ss)
@@@ -699,7 -702,7 +699,7 @@@ EXPORT_SYMBOL_GPL(of_css)
                        ;                                               \
                else
  
- /* walk live descendants in preorder */
+ /* walk live descendants in pre order */
  #define cgroup_for_each_live_descendant_pre(dsct, d_css, cgrp)                \
        css_for_each_descendant_pre((d_css), cgroup_css((cgrp), NULL))  \
                if (({ lockdep_assert_held(&cgroup_mutex);              \
@@@ -933,7 -936,7 +933,7 @@@ void put_css_set_locked(struct css_set 
  
        WARN_ON_ONCE(!list_empty(&cset->threaded_csets));
  
-       /* This css_set is dead. unlink it and release cgroup and css refs */
+       /* This css_set is dead. Unlink it and release cgroup and css refs */
        for_each_subsys(ss, ssid) {
                list_del(&cset->e_cset_node[ssid]);
                css_put(cset->subsys[ssid]);
@@@ -1058,7 -1061,7 +1058,7 @@@ static struct css_set *find_existing_cs
  
        /*
         * Build the set of subsystem state objects that we want to see in the
-        * new css_set. while subsystems can change globally, the entries here
+        * new css_set. While subsystems can change globally, the entries here
         * won't change, so no need for locking.
         */
        for_each_subsys(ss, i) {
@@@ -1148,7 -1151,7 +1148,7 @@@ static void link_css_set(struct list_he
  
        /*
         * Always add links to the tail of the lists so that the lists are
-        * in choronological order.
+        * in chronological order.
         */
        list_move_tail(&link->cset_link, &cgrp->cset_links);
        list_add_tail(&link->cgrp_link, &cset->cgrp_links);
@@@ -3654,7 -3657,7 +3654,7 @@@ static ssize_t cgroup_freeze_write(stru
  
  static int cgroup_file_open(struct kernfs_open_file *of)
  {
-       struct cftype *cft = of->kn->priv;
+       struct cftype *cft = of_cft(of);
  
        if (cft->open)
                return cft->open(of);
  
  static void cgroup_file_release(struct kernfs_open_file *of)
  {
-       struct cftype *cft = of->kn->priv;
+       struct cftype *cft = of_cft(of);
  
        if (cft->release)
                cft->release(of);
@@@ -3674,7 -3677,7 +3674,7 @@@ static ssize_t cgroup_file_write(struc
  {
        struct cgroup_namespace *ns = current->nsproxy->cgroup_ns;
        struct cgroup *cgrp = of->kn->parent->priv;
-       struct cftype *cft = of->kn->priv;
+       struct cftype *cft = of_cft(of);
        struct cgroup_subsys_state *css;
        int ret;
  
  
  static __poll_t cgroup_file_poll(struct kernfs_open_file *of, poll_table *pt)
  {
-       struct cftype *cft = of->kn->priv;
+       struct cftype *cft = of_cft(of);
  
        if (cft->poll)
                return cft->poll(of, pt);
@@@ -4134,7 -4137,7 +4134,7 @@@ struct cgroup_subsys_state *css_next_ch
         * implies that if we observe !CSS_RELEASED on @pos in this RCU
         * critical section, the one pointed to by its next pointer is
         * guaranteed to not have finished its RCU grace period even if we
-        * have dropped rcu_read_lock() inbetween iterations.
+        * have dropped rcu_read_lock() in-between iterations.
         *
         * If @pos has CSS_RELEASED set, its next pointer can't be
         * dereferenced; however, as each css is given a monotonically
@@@ -4382,7 -4385,7 +4382,7 @@@ static struct css_set *css_task_iter_ne
  }
  
  /**
-  * css_task_iter_advance_css_set - advance a task itererator to the next css_set
+  * css_task_iter_advance_css_set - advance a task iterator to the next css_set
   * @it: the iterator to advance
   *
   * Advance @it to the next css_set to walk.
@@@ -5149,6 -5152,15 +5149,6 @@@ static struct cgroup_subsys_state *css_
        if (err)
                goto err_list_del;
  
 -      if (ss->broken_hierarchy && !ss->warned_broken_hierarchy &&
 -          cgroup_parent(parent)) {
 -              pr_warn("%s (%d) created nested cgroup for controller \"%s\" which has incomplete hierarchy support. Nested cgroups may change behavior in the future.\n",
 -                      current->comm, current->pid, ss->name);
 -              if (!strcmp(ss->name, "memory"))
 -                      pr_warn("\"memory\" requires setting use_hierarchy to 1 on the root\n");
 -              ss->warned_broken_hierarchy = true;
 -      }
 -
        return css;
  
  err_list_del:
@@@ -6308,7 -6320,7 +6308,7 @@@ struct cgroup_subsys_state *css_from_id
   *
   * Find the cgroup at @path on the default hierarchy, increment its
   * reference count and return it.  Returns pointer to the found cgroup on
-  * success, ERR_PTR(-ENOENT) if @path doens't exist and ERR_PTR(-ENOTDIR)
+  * success, ERR_PTR(-ENOENT) if @path doesn't exist and ERR_PTR(-ENOTDIR)
   * if @path points to a non-directory.
   */
  struct cgroup *cgroup_get_from_path(const char *path)