lkml.org 
[lkml]   [2018]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [16/32] kernfs, sysfs, cgroup, intel_rdt: Support fs_context [ver #8]
    Date
    Andrei Vagin <avagin@virtuozzo.com> wrote:

    > > > > percpu_ref_reinit(&root->cgrp.self.refcnt);
    > > > > mutex_unlock(&cgroup_mutex);
    > > > > }
    > > > > + cgroup_get(&root->cgrp);
    > > >
    > > > This probably needs to be conditional on ret == 0.
    > >
    > > yes, you are right
    >
    >
    > I've read the code and I think it isn't obvious. A reference will be
    > released id cgroup_fs_context_free() even if ret isn't zero here.
    >
    > I look at do_new_mount()
    >
    > vfs_new_fs_context()
    > ...
    > if (vfs_get_tree())
    > goto out_fc;
    > ....
    > out_fc:
    > put_fs_context(fc);
    > fc->ops->free(fc);
    > cgroup_fs_context_free()
    > cgroup_put(&ctx->root->cgrp);

    Yeah, you're right: ctx->root is set above, so the put will trigger anyway.
    I'll fold both of these changes in.

    David

    \
     
     \ /
      Last update: 2018-06-24 01:35    [W:2.352 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site