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


Groups > linux.kernel > #1579982

Re: [PATCH] kernfs: fix locking around kernfs_ops->release() callback

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH] kernfs: fix locking around kernfs_ops->release() callback
Date 2017-02-13 19:30 +0100
Message-ID <tatxT-7jT-1@gated-at.bofh.it> (permalink)
References <t9MCB-5gO-11@gated-at.bofh.it> <t9MCB-5gO-13@gated-at.bofh.it> <t9MCB-5gO-15@gated-at.bofh.it> <t9MCB-5gO-9@gated-at.bofh.it> <tat4S-6TE-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>

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


Thread

[PATCH] kernfs: fix locking around kernfs_ops->release() callback Tejun Heo <tj@kernel.org> - 2017-02-11 21:40 +0100
  Re: [PATCH] kernfs: fix locking around kernfs_ops->release() callback Tony Lindgren <tony@atomide.com> - 2017-02-13 19:00 +0100
    Re: [PATCH] kernfs: fix locking around kernfs_ops->release() callback Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 19:30 +0100
  Re: [PATCH] kernfs: fix locking around kernfs_ops->release() callback Tejun Heo <tj@kernel.org> - 2017-02-21 22:00 +0100

csiph-web