> 3) There was a report on linux-kernel about a scatter-gather table
> segment counting problem, which led to a panic. I ask for, but have yet
> to receive details on this one. As far as I know, there is only one
> person who has reported this issue.
It seems to apply to scsi drivers that use SG_ALL (ie. don't use the
merge functions from scsi_merge) without clustering (like the aha152x
driver).
If the merge functions are not used, ll_rw_blk will count the number
of non-continuous segments (without actually merging them). __init_io
also doesn't merge them, but counts all segments.
The attached patch fixes that problem by recounting the segments in
that case.
A cleaner way might be to change the default behaviour in ll_rw_blk (e.g.
by default merge functions). As far as I can see the only other thing
beside scsi_merge that references nr_segments is the DAC960 driver.
J�rgen
--- orig/linux/drivers/scsi/scsi_merge.c Wed Dec 15 22:38:13 1999
+++ linux/drivers/scsi/scsi_merge.c Sat Dec 18 16:57:51 1999
@@ -552,7 +552,8 @@
/*
* First we need to know how many scatter gather segments are needed.
*/
- if (!sg_count_valid) {
+ if((SCpnt->host->sg_tablesize == SG_ALL && !use_clustering) ||
+ !sg_count_valid) {
count = __count_segments(req, use_clustering, dma_host);
} else {
count = req->nr_segments;