Re: Still ext2-corruption in test8-pre5 (incl. OOPS)

From: Linus Torvalds (torvalds@transmeta.com)
Date: Wed Sep 06 2000 - 10:16:18 EST


On Wed, 6 Sep 2000, Chris Mason wrote:
>
> Ah, I was missing that __block_prepare_write and __block_write_fullpage
> both set the end_io handler to end_io_sync. In one case, reiserfs is doing
> i/o without properly setting the handler, which is why I was seeing bugs
> caused by the above problem, and ext2 wasn't.

We might actually want to get away from the default handler: it made sense
as we were gradually rewriting old code to conform to new rules, but these
days it's just dangerous when it can result in something like the above. I
_almost_ had the same bug in the truncate patch I sent out yesterday, and
I caught it only because I was thinking hard about it.

It migth be something as simple as doing a

        static void uninitialized_bh_io_handler(struct buffer_head *bh, int uptodate)
        {
                printk("Uhhuh, bh without uninitialized end-io function\n");
                /* ..but fall back on the old default after complaining */
                end_buffer_io_async(bh, uptodate);
        }

which will still _work_, but complain quite loudly if somebody just relies
on the old default hander..

                Linus

-
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 : Thu Sep 07 2000 - 21:00:25 EST