Linux-kernel mailing list archive 2000-40,: Re: block_truncate_page bug?

# Re: block_truncate_page bug?

Alexander Viro (viro@math.psu.edu)
Mon, 2 Oct 2000 05:51:06 -0400 (EDT)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Matthias Andree: "Re: serial driver problems?"
- Previous message: David Weinehall: "Re: 32-bit pid_t / security"

On Mon, 2 Oct 2000, Ben Fennema wrote:

> I'm getting calls to end_buffer_io_bad caused by block_truncate_page.
>
> The path that is causing it is a update page with no buffers, so
> create_empty_buffers gets called. (w/ all the buffers io set to
> end_buffer_io_bad). Since the page is uptodate, the buffer is set to be
> update and the b_end_io is never change to end_buffer_io_sync. Then,
> the buffer is marked dirty. When the end_io function is called, BUG (and
> hard lockup of system).
>
> Am I not supposed to be calling block_truncate_page on a uptodate page with
> no buffers, or is it something that fell through the cracks?

No, that's a bug.

--- fs/buffer.c Mon Oct 2 05:52:22 2000
+++ fs/buffer.c Mon Oct 2 05:58:55 2000
@@ -1807,9 +1807,10 @@
if (Page_Uptodate(page))
set_bit(BH_Uptodate, &bh->b_state);

+ bh->b_end_io = end_buffer_io_sync;
+
if (!buffer_uptodate(bh)) {
err = -EIO;
- bh->b_end_io = end_buffer_io_sync;
ll_rw_block(READ, 1, &bh);
wait_on_buffer(bh);
/* Uhhuh. Read error. Complain and punt. */

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

- Next message: Matthias Andree: "Re: serial driver problems?"
- Previous message: David Weinehall: "Re: 32-bit pid_t / security"