From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752676AbdBMSWX (ORCPT ); Mon, 13 Feb 2017 13:22:23 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:37938 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752433AbdBMSWW (ORCPT ); Mon, 13 Feb 2017 13:22:22 -0500 Date: Mon, 13 Feb 2017 10:22:22 -0800 From: Greg Kroah-Hartman To: Tony Lindgren Cc: Tejun Heo , linux-kernel@vger.kernel.org Subject: Re: [PATCH] kernfs: fix locking around kernfs_ops->release() callback Message-ID: <20170213182222.GA23274@kroah.com> References: <20170209003642.GY3897@atomide.com> <20170211031819.GC19050@mtj.duckdns.org> <20170211044855.GC3897@atomide.com> <20170211203302.GA25834@mtj.duckdns.org> <20170213175724.GH21809@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170213175724.GH21809@atomide.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 13, 2017 at 09:57:25AM -0800, Tony Lindgren wrote: > * Tejun Heo [170211 12:34]: > > The release callback may be called from two places - file release > > operation and kernfs open file draining. kernfs_open_file->mutex is > > used to synchronize the two callsites. This unfortunately leads to > > possible circular locking because of->mutex is used to protect the > > usual kernfs operations which may use locking constructs which are > > held while removing and thus draining kernfs files. > > > > @of->mutex is for synchronizing concurrent kernfs access operations > > and all we need here is synchronization between the releaes and drain > > paths. As the drain path has to grab kernfs_open_file_mutex anyway, > > let's use the mutex to synchronize the release operation instead. > > > > Signed-off-by: Tejun Heo > > Reported-by: Tony Lindgren > > Fixes: 0e67db2f9fe9 ("kernfs: add kernfs_ops->open/release() callbacks") > > --- > > Hello, > > > > Tony, can you please verify that this resolves the lockdep warnings > > that you've been seeing on linux-next? > > Yes thanks this fixes the issue I was seeing: > > Tested-by: Tony Lindgren > > > Greg, this is a fix for the kernfs patches which are being routed > > through the cgroup tree. Once Tony confirms, I'll apply this patch on > > top. Great, no objection from me: Acked-by: Greg Kroah-Hartman