public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Trond Myklebust <Trond.Myklebust@netapp.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: lockdep wierdness...
Date: Thu, 27 Sep 2007 15:00:07 +0100	[thread overview]
Message-ID: <20070927140007.GA17543@infradead.org> (raw)
In-Reply-To: <1190901067.31636.6.camel@twins>

On Thu, Sep 27, 2007 at 03:51:07PM +0200, Peter Zijlstra wrote:
> Christoph,
> 
> does Steve's story make sense? 

Yes.

> All that would need to be done is add an extra lock_class_key to
> file_system_type for i_mutex_dir_key, and extend alloc_inode to say
> something like:
> 
>   if (dir)
>     lockdep_set_class(&inode->i_mutex, &sb->s_type->i_mutex_dir_key);
>   else
>     lockdep_set_class(&inode->i_mutex, &sb->s_type->i_mutex_key);

Unfortunately we don't know what type of inode we have when calling
alloc_inode.  We only know it after reading in the inode from disk,
aka in unlock_new_inode.  Then again there is no reason to use
i_mutex before unlock_new_inode returns, so maybe we could defer
initializing it until unlock_new_inode.  I'm pretty sure we'll have
to fix a few filesystems that take i_mutex before that despite not
needing it, e.g. through i_size_write, though.

  reply	other threads:[~2007-09-27 14:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-24 22:07 lockdep wierdness Trond Myklebust
2007-09-25  2:13 ` Steven Rostedt
2007-09-27 13:51   ` Peter Zijlstra
2007-09-27 14:00     ` Christoph Hellwig [this message]
2007-09-27 15:58       ` Peter Zijlstra

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=20070927140007.GA17543@infradead.org \
    --to=hch@infradead.org \
    --cc=Trond.Myklebust@netapp.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /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