Thread (19 messages) 19 messages, 5 authors, 2015-02-08

Re: Issues with commit 34b48db6 ("block: remove artifical max_hw_sectors cap")

From: Christoph Hellwig <hch@lst.de>
Date: 2014-12-27 15:13:19
Also in: linux-scsi

Possibly related (same subject, not in this thread)

On Tue, Dec 23, 2014 at 11:48:40PM -0800, Kenneth R. Crudup wrote:
quoted
Looks like we need to quirk it.  Can you try to echo different limits
to the /sys/block/sdc/queue/max_hw_sectors_kb  file for the device to
find the limit for it?
Looks like it's 32767; making it an even 32K sectors starts the EIOs again.

To recap for the various lists:

  Vendor: Samsung  Model: D3 Station       Rev: 0202
  Type:   Direct-Access                    ANSI  SCSI revision: 06

It's the 4TB model:

/sys/block/sdc/size:7814037160
/sys/block/sdc/queue/max_hw_sectors_kb:61440

Works OK if I echo 32767 > /sys/block/sdc/queue/max_sectors_kb
Interesting.  Basically this is the limit for modern ATA disks:

drivers/ata/libata-core.c:             dev->max_sectors = ATA_MAX_SECTORS_LBA48;
drivers/ata/libata-core.c:             dev->max_sectors = ATA_MAX_SECTORS_LBA48;
include/linux/ata.h:    ATA_MAX_SECTORS_LBA48   = 65535,/* TODO: 65536? */

Seems like the USB bridge isn't properly communicating this limit to the SCSI
layer.  Maybe it's a good idea to generally limit USB storage to this size?
Has anyone seen a disk out there that's got a (properly-supported)
"max_hw_sectors_kb" >= 32K? If not, maybe we should clamp that value to
prevent other misreporting(?) disks?
Yes, lots of SCSI disks and arrays properly support this.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help