-
由 Michal Hocko 提交于
As cgroup supports rename, it's unsafe to dereference dentry->d_name without proper vfs locks. Fix this by using cgroup_name() rather than dentry directly. Also open code memcg_cache_name because it is called only from kmem_cache_dup which frees the returned name right after kmem_cache_create_memcg makes a copy of it. Such a short-lived allocation doesn't make too much sense. So replace it by a static buffer as kmem_cache_dup is called with memcg_cache_mutex. Signed-off-by: NLi Zefan <lizefan@huawei.com> Signed-off-by: NMichal Hocko <mhocko@suse.cz> Acked-by: NGlauber Costa <glommer@parallels.com> Signed-off-by: NTejun Heo <tj@kernel.org>
d9c10ddd