Messages in this thread Patch in this message | | | Date | Sun, 9 Dec 2001 11:22:08 +0100 | From | Jens Axboe <> | Subject | Re: OOPS: 2.5.1-pre8 - cdrecord + ide_scsi |
| |
On Sun, Dec 09 2001, Carl Ritson wrote: > Got this at the very start of burning a cd, nothing special, using > ide-scsi build into kernel. "cdrecord -v dev=0,0,0 speed=4 img.iso". > Box is Dual-PIII 866, 1GB Ram, all IDE system.
Agrh, because of a bug in ide-scsi conversion this (other) bug went unnoticed for a while. Basically we cannot look up the request queue reliably from a request, since it may not have originated from the block layer. ide-scsi builds it's own, for example. For those, we don't want to trust the sg count either.
Does attached patch work?
-- Jens Axboe
--- /opt/kernel/linux-2.5.1-pre8/drivers/ide/ide-dma.c Sun Dec 9 03:54:19 2001 +++ drivers/ide/ide-dma.c Sun Dec 9 05:03:15 2001 @@ -226,12 +226,13 @@ static int ide_build_sglist (ide_hwif_t *hwif, struct request *rq) { + request_queue_t *q = &hwif->drives[DEVICE_NR(rq->rq_dev) & 1].queue; struct scatterlist *sg = hwif->sg_table; int nents; - nents = blk_rq_map_sg(rq->q, rq, hwif->sg_table); + nents = blk_rq_map_sg(q, rq, hwif->sg_table); - if (nents > rq->nr_segments) + if (rq->q && nents > rq->nr_segments) printk("ide-dma: received %d segments, build %d\n", rq->nr_segments, nents); if (rq_data_dir(rq) == READ) | |