mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Sasha Levin <sasha.levin@oracle.com>
Cc: Greg KH <greg@kroah.com>,
	a.zummo@towertech.it, rtc-linux@googlegroups.com,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: kernfs/rtc: circular dependency between kernfs and ops_lock
Date: Sat, 22 Feb 2014 15:52:17 -0500	[thread overview]
Message-ID: <20140222205217.GC16272@mtj.dyndns.org> (raw)
In-Reply-To: <5308E3AE.3040405@oracle.com>

Hello,

On Sat, Feb 22, 2014 at 12:51:42PM -0500, Sasha Levin wrote:
> While fuzzing with trinity inside a KVM tools guest running the
> latest -next kernel I've stumbled on the following (now with pretty
> line numbers!) spew:

Heh, that's pretty awesome.

> [  218.132898] ======================================================
> [  218.133902] [ INFO: possible circular locking dependency detected ]
> [  218.134820] 3.14.0-rc3-next-20140221-sasha-00008-g0e660cf-dirty #116 Tainted: G        W
> [  218.135911] -------------------------------------------------------
> [  218.136842] trinity-c47/11528 is trying to acquire lock:
> [  218.137613]  (&rtc->ops_lock){+.+.+.}, at: [<drivers/rtc/interface.c:42>] rtc_read_time+0x2b/0x60
> [  218.138909]
> [  218.138909] but task is already holding lock:
> [  218.139802]  (s_active#20){++++.+}, at: [<fs/kernfs/file.c:99>] kernfs_seq_start+0x34/0xa0
> [  218.140087]
> [  218.140087] which lock already depends on the new lock.

The problem is rtc_device_unregister().  It grabs rtc->ops_lock and
then tries to remove the sysfs files.  Some of those sysfs file
implementations acquire rtc->ops_lock, so it of course can lead to
deadlocks.  One can't try to delete a sysfs file which acquires a lock
while holding the same lock.

Thanks.

-- 
tejun

  reply	other threads:[~2014-02-22 20:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-22 17:51 Sasha Levin
2014-02-22 20:52 ` Tejun Heo [this message]
2014-02-24 11:04   ` Alessandro Zummo
2014-03-25 21:52     ` Sasha Levin
2014-03-25 22:39       ` Alessandro Zummo
2014-03-26  0:19         ` Sasha Levin
2014-03-30  0:28           ` Sasha Levin
2014-03-30 16:04             ` Sasha Levin
2014-03-31  9:46               ` Alessandro Zummo
2014-03-31  9:52                 ` Lars-Peter Clausen
2014-03-31 10:43                   ` Alessandro Zummo
2014-03-31 11:07                     ` Lars-Peter Clausen
2014-03-31 12:03                       ` Alessandro Zummo
2014-03-31 12:19                         ` Lars-Peter Clausen
2014-04-02 22:51                           ` Sasha Levin

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=20140222205217.GC16272@mtj.dyndns.org \
    --to=tj@kernel.org \
    --cc=a.zummo@towertech.it \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    --cc=sasha.levin@oracle.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

all inboxes | Powered by JetHome®