Linux SCSI subsystem development
 help / color / mirror / Atom feed
* Invalid optimal transfer size 33553920 accepted when physical_block_size 512
@ 2020-03-22 14:32 Bernhard Sulzer
  2020-03-22 15:45 ` Martin K. Petersen
  2020-03-22 20:57 ` [PATCH] scsi: sd: Optimal I/O size should be a multiple of reported granularity Martin K. Petersen
  0 siblings, 2 replies; 19+ messages in thread
From: Bernhard Sulzer @ 2020-03-22 14:32 UTC (permalink / raw)
  To: linux-scsi

According to the gparted forum 
(http://gparted-forum.surf4.info/viewtopic.php?id=17839) a couple 
sata-usb adapters seem to report an invalid optimal transfer size of 
33553920 (which is 0xFFFF * 512).

This should have been fixed in a83da8a4509d about a year ago by in 
sd_validate_opt_xfer_size by checking whether the optimal transfer size 
opt_xfer_bytes is a multiple of physical_block_size. This works when 
physical block size is 4096, unfortunately it does not when the physical 
block size is 512 (which it is in my case).
Related commit: 
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.1&id=a83da8a4509d3ebfe03bb7fffce022e4d5d4764f

This is pretty curious in itself, because lsblk reports 4096 physical 
sector size / 512 logical sector size and I would have thought physical 
sector size and physical block size should be the same. Is this a bug 
that should be reported?

Anyway, maybe 33553920 should always be marked as invalid?


Equipment used:
     # uname -srv
     Linux 5.6.0-rc6-1-git-00137-gb74b991fb8b9 #1 SMP PREEMPT Sat Mar 21 
22:13:06 CET 2020

     # lsblk /dev/sdc -t
     NAME ALIGNMENT MIN-IO   OPT-IO PHY-SEC LOG-SEC ROTA SCHED       
RQ-SIZE  RA WSAME
     sdc          0   4096 33553920    4096     512    1 
mq-deadline      60 128   32M

     # lsblk /dev/sdc -o +KNAME,HCTL,VENDOR,MODEL,SERIAL,REV
     NAME MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT KNAME HCTL VENDOR   
MODEL          SERIAL    REV
     sdc    8:32   0  7.3T  0 disk            sdc   6:0:0:0 Seagate  
Backup+_Hub_BK NA9Q19AM D781

     # cat /proc/scsi/scsi
     Attached devices:
     [...]
     Host: scsi6 Channel: 00 Id: 00 Lun: 00
       Vendor: Seagate  Model: Backup+ Hub BK   Rev: D781
       Type:   Direct-Access                    ANSI  SCSI revision: 06

     # sudo lsusb -tvvv
     /:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
         ID 1d6b:0003 Linux Foundation 3.0 root hub
         /sys/bus/usb/devices/usb4  /dev/bus/usb/004/001
         |__ Port 2: Dev 6, If 0, Class=Hub, Driver=hub/3p, 5000M
             ID 0bc2:ab45 Seagate RSS LLC
             /sys/bus/usb/devices/4-2  /dev/bus/usb/004/006
             |__ Port 1: Dev 7, If 0, Class=Mass Storage, Driver=uas, 5000M
                 ID 0bc2:ab38 Seagate RSS LLC Backup Plus Hub
                 /sys/bus/usb/
     [...]


Thanks, and please be easy on me


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-03-27  0:59 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-22 14:32 Invalid optimal transfer size 33553920 accepted when physical_block_size 512 Bernhard Sulzer
2020-03-22 15:45 ` Martin K. Petersen
     [not found]   ` <accd7d25-ee35-11b9-e49b-76e20d9550f2@gmail.com>
     [not found]     ` <yq1pnd4uxof.fsf@oracle.com>
2020-03-22 17:41       ` Bernhard Sulzer
     [not found]     ` <yq1pnd4tbxm.fsf@oracle.com>
2020-03-22 19:45       ` Bernhard Sulzer
2020-03-22 21:06         ` Martin K. Petersen
2020-03-22 21:20           ` Bernhard Sulzer
2020-03-22 21:53             ` Bernhard Sulzer
2020-03-22 22:45               ` Martin K. Petersen
2020-03-22 23:10                 ` Bernhard Sulzer
2020-03-22 23:22                 ` Bernhard Sulzer
2020-03-22 23:32                   ` Martin K. Petersen
2020-03-22 23:40                     ` Bernhard Sulzer
2020-03-23  1:41                       ` Martin K. Petersen
2020-03-24 13:49                         ` Bryan Gurney
2020-03-24 15:47                       ` [PATCH] scsi: sd: Fix optimal I/O size for devices that change reported values Martin K. Petersen
2020-03-24 15:52                       ` Invalid optimal transfer size 33553920 accepted when physical_block_size 512 Martin K. Petersen
2020-03-24 16:14                         ` Bernhard Sulzer
2020-03-27  0:54                           ` Martin K. Petersen
2020-03-22 20:57 ` [PATCH] scsi: sd: Optimal I/O size should be a multiple of reported granularity Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox