linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Kernel development list <linux-kernel@vger.kernel.org>
Subject: Re: Lockdep false positive in sysfs
Date: Thu, 26 Apr 2012 15:17:53 -0700	[thread overview]
Message-ID: <20120426221753.GF27486@google.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1204261153320.1530-100000@iolanthe.rowland.org>

On Thu, Apr 26, 2012 at 02:14:30PM -0400, Alan Stern wrote:
> > > Hmmm.... This happens because, by default, sysfs_dirents for the same
> > > attr share the same lockdep key.  This happens from
> > > sysfs_dirent_init_lockdep().  Hmm.... we can,
> > >
> > > * Somehow assign different keys to sysfs_dirents for the specific
> > >   attr.  Use array of attrs indexed by bus depth?
> > 
> > Possible with sysfs_attr_init but pretty ugly.  Especially since it
> > sounds like this is a situation that does not presuppose a maximum
> > depth.  I do remember that the lockdep keys must be statically allocated
> > which makes this a challenge.

The depth is limited by USB spec.

> I agree; this doesn't seem like a good approach.

It sure isn't pretty but probably best matches the situation in the
sense that lockdep would actually be able to know about the nesting
going on.

> Another idea is to have A's method temporarily drop the sysfs readlock.  
> Of course that would put the onus on the USB core of guaranteeing that
> A cannot be removed while this happens, but we can handle that.

Yeah, that's an easier way out.  Please make it a proper sysfs API
call tho so that people working on sysfs later can know of the special
case.

Thanks.

-- 
tejun

  reply	other threads:[~2012-04-26 22:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-25 18:58 Lockdep false positive in sysfs Alan Stern
2012-04-25 21:59 ` Tejun Heo
2012-04-26  8:16   ` Eric W. Biederman
2012-04-26 18:14     ` Alan Stern
2012-04-26 22:17       ` Tejun Heo [this message]
2012-04-27 15:57         ` Alan Stern
2012-04-27 16:09           ` Tejun Heo
2012-05-03 21:30             ` Alan Stern
2012-05-04 16:52               ` Tejun Heo
2012-05-04 19:08                 ` Alan Stern
2012-05-07 19:46                   ` Tejun Heo
2012-05-07 21:51                     ` Alan Stern
2012-05-07 21:55                       ` Tejun Heo
2012-05-08 18:53                         ` Alan Stern
2012-05-09 17:41                           ` Tejun Heo
2012-05-09 17:47                             ` Alan Stern
2012-05-09 17:48                               ` Tejun Heo
2012-04-27 16:27           ` Eric W. Biederman
2012-04-27 18:27             ` Alan Stern
2012-04-27 20:17               ` Tejun Heo
2012-04-27 21:09                 ` Eric W. Biederman
2012-04-27 21:16                   ` Tejun Heo
2012-04-29  2:00                   ` Alan Stern
2012-04-29  2:35                     ` Eric W. Biederman

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=20120426221753.GF27486@google.com \
    --to=tj@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=stern@rowland.harvard.edu \
    /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).