Hello, Zhang.

On Mon, Dec 14, 2015 at 07:45:54PM +0800, [email protected] wrote:
> @@ -2147,6 +2147,13 @@ static void cgroup_kill_sb(struct super_block *sb)
>  {
>       struct kernfs_root *kf_root = kernfs_root_from_sb(sb);
>       struct cgroup_root *root = cgroup_root_from_kf(kf_root);
> +     struct cgroup *child;
> +     int live_child = 0;
> +
> +     mutex_lock(&cgroup_mutex);
> +     cgroup_for_each_live_child(child, &root->cgrp) {
> +             live_child++;
> +     }
>  
>       /*
>        * If @root doesn't have any mounts or children, start killing it.
> @@ -2155,12 +2162,12 @@ static void cgroup_kill_sb(struct super_block *sb)
>        *
>        * And don't kill the default root.
>        */
> -     if (!list_empty(&root->cgrp.self.children) ||
> -         root == &cgrp_dfl_root)
> -             cgroup_put(&root->cgrp);
> +     if (live_child || root == &cgrp_dfl_root)
> +     cgroup_put(&root->cgrp);
>       else
>               percpu_ref_kill(&root->cgrp.self.refcnt);
>  
> +     mutex_unlock(&cgroup_mutex);
>       kernfs_kill_sb(sb);

I don't know.  With the above change, we might fail remounting with
the same option for some controllers which keep residual objects
around.  Changing controller associations has never been supported
correctly and I don't think it'll ever be.  I have no objection to
improving it but this has the potential to regress use cases which
would be more common.

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to