Re: OOPS: 2.5.1-pre8 - cdrecord + ide_scsi

Jens Axboe (axboe@suse.de)
Sun, 9 Dec 2001 11:22:08 +0100


--TYecfFk8j8mZq+dy
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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

--TYecfFk8j8mZq+dy Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=ide-dma-queue-1

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

--TYecfFk8j8mZq+dy-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/