Re: [PATCH v2 2/2] sd: check BLK_DEF_MAX_SECTORS against max_dev_sectors

2016-08-15 Thread Martin K. Petersen
> "Tom" == Tom Yan writes: Tom, >> It would be pretty unusual for a device that is smart enough to >> report a transfer length limit to be constrained to 1 MB and change. Tom> Well, it is done pretty much for libata's SATL. But why? >> rw_max = min(BLK_DEF_MAX_SECTORS, q->limits.max_dev_s

Re: [PATCH v2 2/2] sd: check BLK_DEF_MAX_SECTORS against max_dev_sectors

2016-08-14 Thread Tom Yan
On 14 August 2016 at 17:00, Tom Yan wrote: > > That won't really work. min_t() would, though the line is gonna be a > bit long; not sure if I can/should simply cast the type (unsigned int) > to BLK_DEF_MAX_SECTORS. And which braces are you referring to? > Oh you mean the else-clause braces. Hmm I

Re: [PATCH v2 2/2] sd: check BLK_DEF_MAX_SECTORS against max_dev_sectors

2016-08-14 Thread Tom Yan
On 13 August 2016 at 05:37, Martin K. Petersen wrote: > > It would be pretty unusual for a device that is smart enough to report a > transfer length limit to be constrained to 1 MB and change. > Well, it is done pretty much for libata's SATL. Also since opt_xfer_blocks is checked against dev_max,

Re: [PATCH v2 2/2] sd: check BLK_DEF_MAX_SECTORS against max_dev_sectors

2016-08-12 Thread Martin K. Petersen
> "Tom" == tom ty89 writes: Tom, Tom> The SCSI disk driver sets max_sectors to BLK_DEF_MAX_SECTORS when Tom> the device does not report Optimal Transfer Length. However, it Tom> checks only whether it is smaller than max_hw_sectors, but not Tom> max_dev_sectors. It would be pretty unusual f

[PATCH v2 2/2] sd: check BLK_DEF_MAX_SECTORS against max_dev_sectors

2016-08-12 Thread tom . ty89
From: Tom Yan The SCSI disk driver sets max_sectors to BLK_DEF_MAX_SECTORS when the device does not report Optimal Transfer Length. However, it checks only whether it is smaller than max_hw_sectors, but not max_dev_sectors. Signed-off-by: Tom Yan diff --git a/drivers/scsi/sd.c b/drivers/scsi/s