[ENBD] fr1 hangs when trying to access raid device..

Peter T. Breuer enbd@lists.community.tummy.com
Wed, 5 Feb 2003 17:05:32 +0100 (MET)


"A month of sundays ago [Arve Emil Myr_s] wrote:"
> Feb  5 16:04:35 vserv kernel: fr1 close on device 9:0
> Feb  5 16:04:35 vserv last message repeated 3 times
> Feb  5 16:05:32 vserv kernel: fr1 open device 9:0
> Feb  5 16:05:32 vserv kernel: got request 0
> Feb  5 16:05:32 vserv kernel: Unable to handle kernel NULL pointer dereference at virtual address 00000010

Yes, well that's conclusive. There's a zero request on the queue. This
is kind of hard to understand. Umm ...

        while (!list_empty (&q->queue_head)) {

                struct fr1_device *lo;
                struct fr1_element *e;

                req = CURRENT;

                printk(KERN_DEBUG "got request %x\n", req);

                minor = MINOR (req->rq_dev);

so CURRENT does not point at the head of the queue. This is most likely
indeed a problem over the MAJOR. Yes. I see it ...


 include/linux/blk.h:
 #define CURRENT blkdev_entry_next_request(&blk_dev[MAJOR_NR].request_queue.queue_head)
 
and the problem is that there is an explicit refence to MAJOR_NR there.


The cleanest fix is to replace 

    req = CURRENT;

with

   req = blkdev_entry_next_request(q->queue_head);

(you get to be guinea pig!).

OK, sorry, yes, it is a case of major=9 not working, beacuse major=240
was still hardcoded at this point.

Peter