Re: [patch] __block_write_full_page bug

From: Nick Piggin (nickpiggin_at_yahoo.com.au)
Date: 04/26/05

  • Next message: Andrew Morton: "Re: [patch] optimise loop driver a bit"
    To: Andrew Morton <akpm@osdl.org>
    Date:	Tue, 26 Apr 2005 22:00:20 +1000
    
    

    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.

    > Was an ENOSPC involved?
    >

    No.

    > Those tests for buffer_async_write(bh) are redundant now, aren't they?

    They are, yes. Sorry I noticed that earlier too - they should probably
    be BUG_ON(!buffer_async_write(bh)) instead. Would make things clearer.

    Nick

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Andrew Morton: "Re: [patch] optimise loop driver a bit"

    Relevant Pages

    • Re: [PATCH] fix bad locking in drivers/base/driver.c
      ... Now, I don't mind the blocking (it's a bug to call it twice, and blocking ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • HFS bug
      ... This may or may not be a bug, but I figured that sending out the message ... The kernel gives an Oops that traces back to line buffer.c:2555 (kernel ... to request a blocksize that is a multiple of get_hardsect_size. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: reiser4 plugins
      ... On Friday 24 June 2005 03:57, Hans Reiser wrote: ... this bug you mention is probably not an fs bug. ... of names and tries to remove a file twice if specified twice. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [patch] __block_write_full_page bug
      ... > was being run twice for that buffer. ... I don't think we understand this bug yet. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: root=nfs no longer works in 2.4.22
      ... > eliminate nfs attempts when nfs is not requested. ... > is a nfs request that has been accepted in the past, ... > was accepted as bug and this patch fixed it). ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)