Bug 195219 - One sector less reported through usb-storage than actual hard disk capacity
Summary: One sector less reported through usb-storage than actual hard disk capacity
Status: RESOLVED INVALID
Alias: None
Product: Drivers
Classification: Unclassified
Component: USB (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Greg Kroah-Hartman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-02 06:58 UTC by Guan Xin
Modified: 2017-04-03 19:42 UTC (History)
0 users

See Also:
Kernel Version: 4.1.5, 4.4.59, and maybe others
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Guan Xin 2017-04-02 06:58:23 UTC
When used through a USB-SATA bridge, disk capacity and optimal IO size are reported one sector too less. e.g.,

with USB-SATA bridge:

dmesg:
[ 4542.387857] usb 3-1.2: Product: Expansion
[ 4542.387871] usb 3-1.2: Manufacturer: Seagate
[ 4542.387874] usb 3-1.2: SerialNumber: ********
[ 4542.439329] usbcore: registered new interface driver usb-storage
[ 4542.441451] scsi host8: uas
[ 4542.442730] scsi 8:0:0:0: Direct-Access     Seagate  Expansion        9300 PQ: 0 ANSI: 6
[ 4542.444403] usbcore: registered new interface driver uas
[ 4542.444635] sd 8:0:0:0: [sdd] Spinning up disk...
[ 4543.445400] .....ready
[ 4547.458954] sd 8:0:0:0: [sdd] 7814037167 512-byte logical blocks: (4.00 TB/3.64 TiB)

fdisk -l:
Disk /dev/sdd: 3.7 TiB, 4000787029504 bytes, 7814037167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes

where the disk size is reported as 7814037168-1 sectors, optimal IO size is 32M-512 bytes.


When connected to an SATA port directly:

dmesg:
[    1.640249] ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[    1.643872] ata2.00: ATA-10: ST4000LM024-2AN17V, 0001, max UDMA/133
[    1.644000] ata2.00: 7814037168 sectors, multi 16: LBA48 NCQ (depth 31/32), AA

fdisk -l:
Disk /dev/sdb: 4000.8 GB, 4000787030016 bytes
255 heads, 63 sectors/track, 486401 cylinders, total 7814037168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

The disk capacity, 7814037168 sectors, and optimal IO size of 4k bytes look reasonable.
Comment 1 Greg Kroah-Hartman 2017-04-02 07:45:33 UTC
On Sun, Apr 02, 2017 at 06:58:23AM +0000, bugzilla-daemon@bugzilla.kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=195219
> 
>             Bug ID: 195219
>            Summary: One sector less reported through usb-storage than
>                     actual hard disk capacity


All USB bugs should be sent to the linux-usb@vger.kernel.org mailing
list, and not entered into bugzilla.  Please bring this issue up there,
if it is still a problem in the latest kernel release.
Comment 2 Guan Xin 2017-04-03 19:42:18 UTC
This is a bug in the firmware of the USB-SATA bridge.

Note You need to log in before you can comment on or make changes to this bug.