Re: [PATCH RFC] buffer_head: remove redundant test from wait_on_buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 22 May 2010 23:05:03 -0700
Greg Thelen <gthelen@xxxxxxxxxx> 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.

--
To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux File System Development]     [Linux BTRFS]     [Linux NFS]     [Linux Filesystems]     [Ext4 Filesystem]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Resources]

  Powered by Linux