All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: Zefan Li <lizefan@huawei.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	jweiner@fb.com, LKML <linux-kernel@vger.kernel.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	syzkaller <syzkaller@googlegroups.com>
Subject: Re: cgroup: WARNING in cgroup_kill_sb
Date: Mon, 6 Mar 2017 16:55:15 -0500	[thread overview]
Message-ID: <20170306215515.GH26127@htj.duckdns.org> (raw)
In-Reply-To: <CACT4Y+Y9d3FwPWR+pVNMU1uho9GYwJ6gfJ7AjE+NXYoA0py4ow@mail.gmail.com>

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 = {

  reply	other threads:[~2017-03-06 21:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02 19:15 cgroup: WARNING in cgroup_kill_sb Dmitry Vyukov
2017-03-06 21:55 ` Tejun Heo [this message]
2017-03-07  9:11   ` Dmitry Vyukov
2017-03-07 19:45     ` Tejun Heo
2017-03-07 19:52       ` Dmitry Vyukov
2017-03-09  9:24 ` Zefan Li
2017-03-09  9:48   ` Dmitry Vyukov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170306215515.GH26127@htj.duckdns.org \
    --to=tj@kernel.org \
    --cc=dvyukov@google.com \
    --cc=ebiederm@xmission.com \
    --cc=jweiner@fb.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=syzkaller@googlegroups.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.