From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Tony Lindgren <tony@atomide.com>
Cc: Tejun Heo <tj@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kernfs: fix locking around kernfs_ops->release() callback
Date: Mon, 13 Feb 2017 10:22:22 -0800 [thread overview]
Message-ID: <20170213182222.GA23274@kroah.com> (raw)
In-Reply-To: <20170213175724.GH21809@atomide.com>
On Mon, Feb 13, 2017 at 09:57:25AM -0800, Tony Lindgren wrote:
> * Tejun Heo <tj@kernel.org> [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 <tj@kernel.org>
> > Reported-by: Tony Lindgren <tony@atomide.com>
> > 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 <tony@atomide.com>
>
> > 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 <gregkh@linuxfoundation.org>
next prev parent reply other threads:[~2017-02-13 18:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170209003642.GY3897@atomide.com>
[not found] ` <20170211031819.GC19050@mtj.duckdns.org>
[not found] ` <20170211044855.GC3897@atomide.com>
2017-02-11 20:33 ` [PATCH] kernfs: fix locking around kernfs_ops->release() callback Tejun Heo
2017-02-13 17:57 ` Tony Lindgren
2017-02-13 18:22 ` Greg Kroah-Hartman [this message]
2017-02-21 20:50 ` Tejun Heo
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=20170213182222.GA23274@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=tony@atomide.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).