Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932484AbdCFVzh (ORCPT ); Mon, 6 Mar 2017 16:55:37 -0500 Received: from mail-yw0-f195.google.com ([209.85.161.195]:36503 "EHLO mail-yw0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753958AbdCFVzZ (ORCPT ); Mon, 6 Mar 2017 16:55:25 -0500 Date: Mon, 6 Mar 2017 16:55:15 -0500 From: Tejun Heo To: Dmitry Vyukov Cc: Zefan Li , "Eric W. Biederman" , jweiner@fb.com, LKML , Al Viro , "linux-fsdevel@vger.kernel.org" , syzkaller Subject: Re: cgroup: WARNING in cgroup_kill_sb Message-ID: <20170306215515.GH26127@htj.duckdns.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 925 Lines: 30 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 = {