From: Bernhard Sulzer <micraft.b@gmail.com>
To: linux-scsi@vger.kernel.org
Subject: Invalid optimal transfer size 33553920 accepted when physical_block_size 512
Date: Sun, 22 Mar 2020 15:32:38 +0100 [thread overview]
Message-ID: <33fb522e-4f61-1b76-914f-c9e6a3553c9b@gmail.com> (raw)
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
next reply other threads:[~2020-03-22 14:32 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-22 14:32 Bernhard Sulzer [this message]
2020-03-22 15:45 ` Invalid optimal transfer size 33553920 accepted when physical_block_size 512 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
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=33fb522e-4f61-1b76-914f-c9e6a3553c9b@gmail.com \
--to=micraft.b@gmail.com \
--cc=linux-scsi@vger.kernel.org \
/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.