Re: Oops on 2.2.14 While Doing Direct I/O.

From: Andrea Arcangeli (andrea@suse.de)
Date: Tue Feb 22 2000 - 11:49:04 EST


On Mon, 21 Feb 2000, Jeff V. Merkey wrote:

>//
>// THIS CODE CRASHES WITH AN OOPS MESSAGE UNDER 2.2.14 (and all 2.2.X
>kernels)
>//
[..]
> bh[i]->b_this_page = bh[(i + 1) % sectors]; // create circular
>list
> bh[i]->b_state = 0;
> bh[i]->b_next_free = NULL;
> bh[i]->b_count = 0;
> bh[i]->b_size = 512;
> bh[i]->b_data = (char *)&Sector[i * bps];
> bh[i]->b_list = BUF_CLEAN;
> bh[i]->b_dev = (int)NWDisk->PhysicalDiskHandle;
> bh[i]->b_blocknr = (StartingLBA + i);
> bh[i]->b_count = 1;
> bh[i]->b_flushtime = 0;
>
> clear_bit(BH_Uptodate, &bh[i]->b_state);

1) You forgot to set the bh[i]->b_end_io callback, that's why it
   crashes immediatly within the IDE irq handler (probably killing the
   idle task or similar).

2) It seems you don't need to set the b_this_page at all (unless you need
   it in the end_io callback). You can set it to zero to trap accesses
   to it. Also if relly you want to set it you'd better set
   bh[i]->b_this_page to bh itself since your b_data storage memory is
   512byte wide thus is sounds more correct.

3) Note that WRITEA is obsoleted in 2.3.x.

Andrea

-
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/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:30 EST