All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Kenneth R. Crudup" <kenny@panix.com>
Cc: linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org,
	linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net
Subject: Re: Issues with commit 34b48db6 ("block: remove artifical max_hw_sectors cap")
Date: Sat, 27 Dec 2014 16:13:19 +0100	[thread overview]
Message-ID: <20141227151319.GA18607@lst.de> (raw)
In-Reply-To: <alpine.DEB.2.10.1412232342040.4626@tosh-p75a>

On Tue, Dec 23, 2014 at 11:48:40PM -0800, Kenneth R. Crudup wrote:
> > 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.

  parent reply	other threads:[~2014-12-27 15:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.DEB.2.10.1412211420560.4323@tosh-p75a>
2014-12-23  8:31 ` Issues with commit 34b48db6 ("block: remove artifical max_hw_sectors cap") Christoph Hellwig
2014-12-24  7:48   ` Kenneth R. Crudup
2014-12-24  8:18     ` Kenneth R. Crudup
2014-12-27 15:13     ` Christoph Hellwig [this message]
2014-12-29  3:10       ` Alan Stern
2014-12-30 11:28         ` Christoph Hellwig
2014-12-30 15:34           ` Alan Stern
2014-12-30 15:50             ` James Bottomley
2014-12-30 16:12               ` Alan Stern
     [not found]                 ` <Pine.LNX.4.44L0.1412301109050.32416-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
2014-12-30 16:25                   ` James Bottomley
2014-12-30 16:45                     ` Alan Stern
2014-12-30 16:54                       ` James Bottomley
2014-12-30 16:19             ` Douglas Gilbert
2014-12-30 16:36               ` Kenneth R. Crudup
2015-01-05 17:19                 ` Christoph Hellwig
2015-01-05 20:07                   ` Alan Stern
2015-01-05 20:19                     ` Kenneth R. Crudup
2015-01-19  9:45                     ` Kenneth R. Crudup
2015-01-19 15:55                       ` Alan Stern
2015-01-19 22:59                         ` Kenneth R. Crudup
2015-02-08 22:11                         ` Kenneth R. Crudup
2015-01-05 17:18               ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141227151319.GA18607@lst.de \
    --to=hch@lst.de \
    --cc=kenny@panix.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=usb-storage@lists.one-eyed-alien.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.