public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Andrew Morton <akpm@osdl.org>
Cc: andrea@suse.de, linux-kernel@vger.kernel.org
Subject: Re: [patch] __block_write_full_page bug
Date: Wed, 27 Apr 2005 10:10:19 +1000	[thread overview]
Message-ID: <426ED86B.9020600@yahoo.com.au> (raw)
In-Reply-To: <20050426054729.24ab6027.akpm@osdl.org>

Andrew Morton wrote:
> Nick Piggin <nickpiggin@yahoo.com.au> wrote:
> 
>>On Tue, 2005-04-26 at 04:50 -0700, Andrew Morton wrote:
>> > Nick Piggin <nickpiggin@yahoo.com.au> wrote:
>> > >
>> > >  When running
>> > >  	fsstress -v -d $DIR/tmp -n 1000 -p 1000 -l 2
>> > >  on an ext2 filesystem with 1024 byte block size, on SMP i386 with 4096 byte
>> > >  page size over loopback to an image file on a tmpfs filesystem, I would
>> > >  very quickly hit
>> > >  	BUG_ON(!buffer_async_write(bh));
>> > >  in fs/buffer.c:end_buffer_async_write
>> > > 
>> > >  It seems that more than one request would be submitted for a given bh
>> > >  at a time. __block_write_full_page looks like the culprit - with the
>> > >  following patch things are very stable.
>> > 
>> > What's the bug?  I don't see it.
>> > 
>>
>> Ah, the bug is that end_buffer_async_write first does
>> 	BUG_ON(!buffer_async_write(bh));
>> then a bit later does
>> 	clear_buffer_async_write(bh);
>>
>> That's where it was blowing up for me, because end_buffer_async_write
>> was being run twice for that buffer.
>>
>> Or did you mean *how* is it being run twice? I didn't exactly find
>> the stack traces involved, but I imagine that simply testing
>> buffer_async_write catches other requests in flight - ie. we've
>> lost track of exactly which ones we own.
>>
> 
> 
> How can such a thing come about?  Both PageLocked() and PageWriteback() are
> supposed to stop new writeback being started against the page.
> 

You have a point.

> <looks>
> 
> Were you using nobh?  I guess not.  What's to stop the new

No

> mpage_writepage() from trying to write a page which is already under
> PageWriteback()?
> 

Don't know... I didn't think mapping->writepage should be called
for a PageWriteback page?

> I don't think we understand this bug yet.
> 

It appears not. I'll look into it further.

-- 
SUSE Labs, Novell Inc.


  reply	other threads:[~2005-04-27  0:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-25  3:56 [patch] __block_write_full_page bug Nick Piggin
2005-04-26 11:50 ` Andrew Morton
2005-04-26 12:00   ` Nick Piggin
2005-04-26 12:47     ` Andrew Morton
2005-04-27  0:10       ` Nick Piggin [this message]
2005-04-27  1:02   ` Nick Piggin

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=426ED86B.9020600@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@osdl.org \
    --cc=andrea@suse.de \
    --cc=linux-kernel@vger.kernel.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