Re: bforget and protected buffers

Chuck Lever (cel@monkey.org)
Tue, 27 Apr 1999 14:01:54 -0400 (EDT)


On Tue, 27 Apr 1999, Andrea Arcangeli wrote:
> >see the buffer_busy macro defined later in fs/buffer.c for use by
> >try_to_free_buffers(). this will prevent protected ramdisk buffers from
> >being reclaimed, although they can still appear on the free list if
> >someone decides to add bforget() calls to the ramdisk logic... presumably
> >if ramdisk decides to bforget a buffer, it doesn't care about it's
> >contents.
> >
> >now, if you add this to bforget():
> >
> > buf->b_state = 0;
> >
> >that defeats the buffer_busy check in try_to_free_buffers(), so maybe the
> >check should be made explicitly in bforget() if you add this line.
>
> Even if you don't add the buf->b_state = 0 by hand in bforgot, you'll get
> b_state set to 0 by getblk a bit after.

oops.

ok, well, is there a case where init_buffer() itself shouldn't set b_state
to zero? brw_page() uses init_buffer(), but i can't see the ramdisk logic
ever using brw_page().

i still say that at this point, ramdisk support doesn't use bforget() so
there isn't an urgent need to add the extra check. however, i can see a
latent bug there, and that for consistency and completeness, bforget()
probably ought to use buffer_busy.

- Chuck Lever

--
corporate:	<chuckl@netscape.com>
personal:	<chucklever@netscape.net> or <cel@monkey.org>

The Linux Scalability project: http://www.citi.umich.edu/projects/linux-scalability/

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