lkml.org 
[lkml]   [2000]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Oops on 2.2.14 While Doing Direct I/O.
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/

\
 
 \ /
  Last update: 2005-03-22 13:56    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site