Re: [SCSI] Set max_phys_segments to sg_tablesize

From: Jens Axboe
Date: Wed Oct 15 2003 - 07:03:59 EST


On Wed, Oct 15 2003, Herbert Xu wrote:
> Hi:
>
> Many SCSI host drivers assume that use_sg will be <= sg_tablesize.
> Hence they may break under 2.6 as the number of physical segments
> is not limited by sg_tablesize. This patch fixes that.

Is sg_tablesize guarenteed to be set? Looks like you need a

===== drivers/scsi/hosts.c 1.94 vs edited =====
--- 1.94/drivers/scsi/hosts.c Sun Sep 21 19:52:38 2003
+++ edited/drivers/scsi/hosts.c Wed Oct 15 14:02:14 2003
@@ -234,7 +234,11 @@
shost->hostt = sht;
shost->this_id = sht->this_id;
shost->can_queue = sht->can_queue;
+
shost->sg_tablesize = sht->sg_tablesize;
+ if (!shost->sg_tablesize)
+ shost->sg_tablesize = MAX_PHYS_SEGMENTS;
+
shost->cmd_per_lun = sht->cmd_per_lun;
shost->unchecked_isa_dma = sht->unchecked_isa_dma;
shost->use_clustering = sht->use_clustering;

additionally.

--
Jens Axboe

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