Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1593761

Re: cgroup: WARNING in cgroup_kill_sb

From Tejun Heo <tj@kernel.org>
Newsgroups linux.kernel
Subject Re: cgroup: WARNING in cgroup_kill_sb
Date 2017-03-06 23:00 +0100
Message-ID <ti8PE-5S2-31@gated-at.bofh.it> (permalink)
References <tgETD-6XA-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hello, Dmitry.

Can you please see whether the following patch resolves the issue?
I'm a bit nervous about it ending up in circular dependency, but I
*think* it should be okay.

Thanks.

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 0125589..9c40421 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -1820,6 +1820,8 @@ 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);
 
+	mutex_lock(&cgroup_mutex);
+
 	/*
 	 * If @root doesn't have any mounts or children, start killing it.
 	 * This prevents new mounts by disabling percpu_ref_tryget_live().
@@ -1834,6 +1836,8 @@ static void cgroup_kill_sb(struct super_block *sb)
 		percpu_ref_kill(&root->cgrp.self.refcnt);
 
 	kernfs_kill_sb(sb);
+
+	mutex_unlock(&cgroup_mutex);
 }
 
 struct file_system_type cgroup_fs_type = {

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

cgroup: WARNING in cgroup_kill_sb Dmitry Vyukov <dvyukov@google.com> - 2017-03-02 20:50 +0100
  Re: cgroup: WARNING in cgroup_kill_sb Tejun Heo <tj@kernel.org> - 2017-03-06 23:00 +0100
    Re: cgroup: WARNING in cgroup_kill_sb Dmitry Vyukov <dvyukov@google.com> - 2017-03-07 10:20 +0100
      Re: cgroup: WARNING in cgroup_kill_sb Tejun Heo <tj@kernel.org> - 2017-03-07 20:50 +0100
  Re: cgroup: WARNING in cgroup_kill_sb Zefan Li <lizefan@huawei.com> - 2017-03-09 10:30 +0100
    Re: cgroup: WARNING in cgroup_kill_sb Dmitry Vyukov <dvyukov@google.com> - 2017-03-09 10:50 +0100

csiph-web