Re: block_truncate_page bug?

From: Alexander Viro (viro@math.psu.edu)
Date: Mon Oct 02 2000 - 04:51:06 EST


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/



This archive was generated by hypermail 2b29 : Sat Oct 07 2000 - 21:00:09 EST