linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Greg Thelen <gthelen@google.com>
Cc: Richard Kennedy <richard@rsk.demon.co.uk>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Jens Axboe <jens.axboe@oracle.com>,
	lkml <linux-kernel@vger.kernel.org>,
	Nick Piggin <npiggin@suse.de>, Jeff Mahoney <jeffm@suse.com>,
	reiserfs-devel@vger.kernel.org
Subject: Re: [PATCH RFC]  buffer_head: remove redundant test from wait_on_buffer
Date: Mon, 7 Jun 2010 13:24:00 -0700	[thread overview]
Message-ID: <20100607132400.492613f1.akpm@linux-foundation.org> (raw)
In-Reply-To: <xr93ljbbw3u8.fsf@ninji.mtv.corp.google.com>

On Sat, 22 May 2010 23:05:03 -0700
Greg Thelen <gthelen@google.com> wrote:

> > --- a/fs/buffer.c~buffer_head-remove-redundant-test-from-wait_on_buffer-fix
> > +++ a/fs/buffer.c
> > @@ -90,6 +90,12 @@ EXPORT_SYMBOL(unlock_buffer);
> >   */
> >  void __wait_on_buffer(struct buffer_head * bh)
> >  {
> > +	/*
> > +	 * Calling wait_on_buffer() against a zero-ref buffer is a nasty bug
> > +	 * because it will almost always "work".  However this buffer can be
> > +	 * reclaimed at any time.  So check for it.
> > +	 */
> > +	VM_BUG_ON(atomic_read(&bh->b_count) == 0);
> 
> My system is failing this VM_BUG_ON() occasionally.  I think this is due to
> wait_on_buffer() calls with b_count=0 from locations within fs/buffer.c.

Thanks.

Yup, the buffers are protected by lock_page().

> These
> occasional b_count=0 callers are caused by buf reads that complete quickly -
> after the I/O is issued but before it is waited upon.  Such fs/buffer.c callers
> need to either bypass this assertion or increment b_count.  I don't think they
> need to grab an b_count reference.  I suggest a bypass routine in the patch
> below.  Does this look good?

I think I'll just drop
buffer_head-remove-redundant-test-from-wait_on_buffer-fix.patch and
wait_on_buffer-remove-the-buffer_locked-test.patch.


      reply	other threads:[~2010-06-07 20:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-16 10:58 [PATCH RFC] buffer_head: remove redundant test from wait_on_buffer Richard Kennedy
2010-04-16 21:51 ` Andrew Morton
2010-04-16 22:18   ` Jeff Mahoney
2010-04-19  8:44   ` Richard Kennedy
2010-05-23  6:05   ` Greg Thelen
2010-06-07 20:24     ` Andrew Morton [this message]

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=20100607132400.492613f1.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=gthelen@google.com \
    --cc=jeffm@suse.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npiggin@suse.de \
    --cc=reiserfs-devel@vger.kernel.org \
    --cc=richard@rsk.demon.co.uk \
    --cc=viro@zeniv.linux.org.uk \
    /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).