On Thu, Sep 21 2000, ismael ripoll wrote:
> The problem seems to be originatied by the new block devices
> interface..
Right
> The bug Is that in the function sbpcd_end_request
> the value of "req->q" is NULL.. and then:
>
> list_add(&req->queue, &req->q->queue_head); << FAILS >>
And I don't see why it should do this. It would make more sense
to just leave the current request in the queue, and let end_request
deal with dequeueing when it is done.
Could you try this patch? Completely untested and note even compiled :)
--
* Jens Axboe <[EMAIL PROTECTED]>
* SuSE Labs
--- /opt/kernel/linux-2.4.0-test9-pre5/drivers/cdrom/sbpcd.c Mon Sep 11 02:49:27
2000
+++ drivers/cdrom/sbpcd.c Thu Sep 21 16:27:09 2000
@@ -4864,10 +4864,6 @@
*
*/
#undef DEBUG_GTL
-static inline void sbpcd_end_request(struct request *req, int uptodate) {
- list_add(&req->queue, &req->q->queue_head);
- end_request(uptodate);
-}
/*==========================================================================*/
/*
* I/O request routine, called from Linux kernel.
@@ -4902,12 +4898,11 @@
#endif
INIT_REQUEST;
req=CURRENT; /* take out our request so no other */
- blkdev_dequeue_request(req); /* task can fuck it up GTL */
if (req->rq_status == RQ_INACTIVE)
- sbpcd_end_request(req, 0);
+ end_request(req, 0);
if (req -> sector == -1)
- sbpcd_end_request(req, 0);
+ end_request(req, 0);
spin_unlock_irq(&io_request_lock);
down(&ioctl_read_sem);
@@ -4949,7 +4944,7 @@
#endif
up(&ioctl_read_sem);
spin_lock_irq(&io_request_lock);
- sbpcd_end_request(req, 1);
+ end_request(req, 1);
goto request_loop;
}
@@ -4990,7 +4985,7 @@
#endif
up(&ioctl_read_sem);
spin_lock_irq(&io_request_lock);
- sbpcd_end_request(req, 1);
+ end_request(req, 1);
goto request_loop;
}
}
@@ -5006,7 +5001,7 @@
up(&ioctl_read_sem);
sbp_sleep(0); /* wait a bit, try again */
spin_lock_irq(&io_request_lock);
- sbpcd_end_request(req, 0);
+ end_request(req, 0);
goto request_loop;
}
/*==========================================================================*/
@@ -5815,7 +5810,6 @@
#endif MODULE
}
blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
- blk_queue_headactive(BLK_DEFAULT_QUEUE(MAJOR_NR), 0);
read_ahead[MAJOR_NR] = buffers * (CD_FRAMESIZE / 512);
request_region(CDo_command,4,major_name);