public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Andi Kleen <ak@suse.de>
Cc: rjw@sisk.pl, linux-kernel@vger.kernel.org, cmm@us.ibm.com,
	pbadari@us.ibm.com
Subject: Re: [discuss] Re: 2.6.16-rc5-mm3: spinlock bad magic on CPU#0 on AMD64
Date: Sun, 12 Mar 2006 15:23:34 -0800	[thread overview]
Message-ID: <20060312152334.3d37fe6b.akpm@osdl.org> (raw)
In-Reply-To: <200603121610.31881.ak@suse.de>

Andi Kleen <ak@suse.de> wrote:
>
> > Still.  It seems that what's happened is that we took a pagefault while
>  > reiserfs had a transaction open.  The fault is against a mmapped ext3 file
>  > and we ended up in the recently-reworked ext3_get_block() which tests
>  > journal_current_handle() to work out whether we're in a write or a read. 
>  > oops.  The presence of reiserfs journal_info makes it decide it's a write,
>  > not a read so it starts treating a reiserfs journal_info as an ext3 one.
>  > 
>  > The code used to work OK because it was only for direct-IO, which doesn't
>  > get recurred into like this.  But it got used for regular I/O in -mm.
> 
>  Oops. Can this happen in more situations?

I don't _think_ so, but it's pretty scary.  The code's been this way for a
while.

Typical scenario:

	reiserfs_journal_start		- sets current->journal_info
	  copy_from_user
	    pagefault
	      ext3_readpages()

As long as ext3_readpage[s]() doesn't try to start a transaction we're OK. 
And it shouldn't, if create==0.

Fortunately filemap_nopage() doesn't do atime updates.  If it did, things
would get messy.

We do have deadlock possibilities in there - filemap_nopage() does
lock_page() inside journal_start(), whereas generic_file_write() does
journal_start() inside lock_page().  Chris Mason and I have stared
unhappily at that a few times.  Hard to fix.

But I don't _think_ we have any more journal_start() recursions like this -
ext3 tends to get pretty noisy if it detects that in unexpected places.


  reply	other threads:[~2006-03-12 23:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-11 23:24 2.6.16-rc5-mm3: spinlock bad magic on CPU#0 on AMD64 Rafael J. Wysocki
2006-03-11 23:36 ` Andrew Morton
2006-03-12 10:27   ` Rafael J. Wysocki
2006-03-12 12:49     ` [discuss] " Rafael J. Wysocki
2006-03-12 22:26       ` Andrew Morton
2006-03-12 15:10         ` Andi Kleen
2006-03-12 23:23           ` Andrew Morton [this message]
2006-03-13 11:34         ` Rafael J. Wysocki
2006-03-13 11:45           ` Andrew Morton
2006-03-13 12:07             ` Rafael J. Wysocki
2006-03-13 16:02               ` Badari Pulavarty
2006-03-13 18:12                 ` Rafael J. Wysocki

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=20060312152334.3d37fe6b.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=ak@suse.de \
    --cc=cmm@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbadari@us.ibm.com \
    --cc=rjw@sisk.pl \
    /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