Modified patch to use min_not_zero() Ran a number of tests overnight on F/C, SCSI/SAS and SRP (RDMA) and no issues found. Tested-by: Laurence Oberman <loberman@xxxxxxxxxx> Laurence Oberman Principal Software Maintenance Engineer Red Hat Global Support Services ----- Original Message ----- From: "Laurence Oberman" <loberman@xxxxxxxxxx> To: "Bart Van Assche" <bart.vanassche@xxxxxxxxxxx> Cc: "Christoph Hellwig" <hch@xxxxxx>, linux-rdma@xxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx Sent: Monday, April 11, 2016 7:44:24 PM Subject: Re: [PATCH 1/2] scsi: add a max_segment_size limitation to struct Scsi_Host Thanks Bart Good catch, I completely missed it. Laurence Oberman Principal Software Maintenance Engineer Red Hat Global Support Services ----- Original Message ----- From: "Bart Van Assche" <bart.vanassche@xxxxxxxxxxx> To: "Christoph Hellwig" <hch@xxxxxx>, linux-rdma@xxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx Sent: Monday, April 11, 2016 7:32:16 PM Subject: Re: [PATCH 1/2] scsi: add a max_segment_size limitation to struct Scsi_Host On 04/11/2016 03:47 PM, Christoph Hellwig wrote: > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > index 8106515..04c660d 100644 > --- a/drivers/scsi/scsi_lib.c > +++ b/drivers/scsi/scsi_lib.c > @@ -2120,7 +2120,8 @@ static void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q) > blk_queue_segment_boundary(q, shost->dma_boundary); > dma_set_seg_boundary(dev, shost->dma_boundary); > > - blk_queue_max_segment_size(q, dma_get_max_seg_size(dev)); > + blk_queue_max_segment_size(q, > + min(shost->max_segment_size, dma_get_max_seg_size(dev))); > > if (!shost->use_clustering) > q->limits.cluster = 0; Hello Christoph, Since Scsi_Host.max_segment_size is initialized to zero, shouldn't min() be changed into min_not_zero()? Bart. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html