All of lore.kernel.org
 help / color / mirror / Atom feed
* Debug scsi message in linux 4.19.31
@ 2019-03-24 13:07 Hussam Al-Tayeb
  2019-03-24 16:18 ` Randy Dunlap
  0 siblings, 1 reply; 6+ messages in thread
From: Hussam Al-Tayeb @ 2019-03-24 13:07 UTC (permalink / raw)
  To: linux-kernel

Hi. I'm seeing a debug message in linux stable kernel 4.19.31 with this
patch
scsi-sd-optimal-i-o-size-should-be-a-multiple-of-physical-block-
size.patch

I am getting:
Mar 23 17:40:10 hades kernel: sd 0:0:0:0: [sda] Optimal transfer size 0
bytes < PAGE_SIZE (4096 bytes)
Mar 23 17:40:10 hades kernel: sd 2:0:0:0: [sdb] Optimal transfer size 0
bytes < PAGE_SIZE (4096 bytes)
Mar 23 17:46:43 hades kernel: sd 4:0:0:0: [sdc] Optimal transfer size 0
bytes < PAGE_SIZE (4096 bytes)

sda and sdb are physically attached SATA mechanical disks (Western
Digital and Seagate, respectively).
sdc is a kingston usb flash drive. All three disks use ext4 luks
encrypted partitions.
Is the fact that it is reporting 0 as optimal transfer size something I
should worry about? Note that the the three storage devices are from
three different manufacturers.
This particular machine is a Lenovo Intel(R) Core(TM) i5-6400 CPU @
2.70GHz with 16GB Kingston DDR4 ram.

I tried moving the root disk to another machine (a DELL Core I7 7700
with slightly faster ram from Samsung) and I saw the same message.

This seems like a patch that fits better in a hardware vendor or
operating system distributor tree than the upstream kernel. Shouldn't
stable tree kernels only contain direct fixes and regression fixes?
Does it really belong in an LTS kernel?

Please CC me in your reply as I am not subscribed to the list.
Thank you.


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

* Re: Debug scsi message in linux 4.19.31
  2019-03-24 13:07 Debug scsi message in linux 4.19.31 Hussam Al-Tayeb
@ 2019-03-24 16:18 ` Randy Dunlap
  2019-03-25  0:04   ` Martin K. Petersen
  2019-03-27 16:11   ` [PATCH] scsi: sd: Quiesce warning if device does not report optimal I/O size Martin K. Petersen
  0 siblings, 2 replies; 6+ messages in thread
From: Randy Dunlap @ 2019-03-24 16:18 UTC (permalink / raw)
  To: Hussam Al-Tayeb, linux-kernel, linux-scsi, Martin K. Petersen

[adding linux-scsi and mkp]

On 3/24/19 6:07 AM, Hussam Al-Tayeb wrote:
> Hi. I'm seeing a debug message in linux stable kernel 4.19.31 with this
> patch
> scsi-sd-optimal-i-o-size-should-be-a-multiple-of-physical-block-
> size.patch
> 
> I am getting:
> Mar 23 17:40:10 hades kernel: sd 0:0:0:0: [sda] Optimal transfer size 0
> bytes < PAGE_SIZE (4096 bytes)
> Mar 23 17:40:10 hades kernel: sd 2:0:0:0: [sdb] Optimal transfer size 0
> bytes < PAGE_SIZE (4096 bytes)
> Mar 23 17:46:43 hades kernel: sd 4:0:0:0: [sdc] Optimal transfer size 0
> bytes < PAGE_SIZE (4096 bytes)
> 
> sda and sdb are physically attached SATA mechanical disks (Western
> Digital and Seagate, respectively).
> sdc is a kingston usb flash drive. All three disks use ext4 luks
> encrypted partitions.
> Is the fact that it is reporting 0 as optimal transfer size something I
> should worry about? Note that the the three storage devices are from
> three different manufacturers.
> This particular machine is a Lenovo Intel(R) Core(TM) i5-6400 CPU @
> 2.70GHz with 16GB Kingston DDR4 ram.
> 
> I tried moving the root disk to another machine (a DELL Core I7 7700
> with slightly faster ram from Samsung) and I saw the same message.
> 
> This seems like a patch that fits better in a hardware vendor or
> operating system distributor tree than the upstream kernel. Shouldn't
> stable tree kernels only contain direct fixes and regression fixes?
> Does it really belong in an LTS kernel?
> 
> Please CC me in your reply as I am not subscribed to the list.
> Thank you.
> 


-- 
~Randy

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

* Re: Debug scsi message in linux 4.19.31
  2019-03-24 16:18 ` Randy Dunlap
@ 2019-03-25  0:04   ` Martin K. Petersen
  2019-03-27 16:11   ` [PATCH] scsi: sd: Quiesce warning if device does not report optimal I/O size Martin K. Petersen
  1 sibling, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2019-03-25  0:04 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Hussam Al-Tayeb, linux-kernel, linux-scsi, Martin K. Petersen


Randy,

>> Mar 23 17:40:10 hades kernel: sd 0:0:0:0: [sda] Optimal transfer size 0
>> bytes < PAGE_SIZE (4096 bytes)

We're just trying to weed out the devices that report garbage in this
field. But of course none of the devices I tested with put 0 in there.

>> Does it really belong in an LTS kernel?

The patch does fix problems for devices that report a nonsensical
value. But it is a regression that it now prints a warning for devices
that don't report an optimal I/O size at all.

Sorry about that. Will fix tomorrow!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* [PATCH] scsi: sd: Quiesce warning if device does not report optimal I/O size
  2019-03-24 16:18 ` Randy Dunlap
  2019-03-25  0:04   ` Martin K. Petersen
@ 2019-03-27 16:11   ` Martin K. Petersen
  2019-03-27 16:46     ` Bart Van Assche
  1 sibling, 1 reply; 6+ messages in thread
From: Martin K. Petersen @ 2019-03-27 16:11 UTC (permalink / raw)
  To: linux-scsi; +Cc: Martin K. Petersen, Hussam Al-Tayeb, Randy Dunlap, stable

Commit a83da8a4509d ("scsi: sd: Optimal I/O size should be a multiple
of physical block size") split one conditional into several separate
statements in an effort to provide more accurate warning messages when
a device reports a nonsensical value. However, this reorganization
accidentally dropped the precondition of the reported value being
larger than zero. This lead to a warning getting emitted on devices
that do not report an optimal I/O size at all.

Remain silent if a device does not report an optimal I/O size.

Fixes: a83da8a4509d ("scsi: sd: Optimal I/O size should be a multiple of physical block size")
Reported-by: Hussam Al-Tayeb <ht990332@gmx.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
---
 drivers/scsi/sd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 9d8e15d03d2b..87d542de2db7 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3074,6 +3074,9 @@ static bool sd_validate_opt_xfer_size(struct scsi_disk *sdkp,
 	unsigned int opt_xfer_bytes =
 		logical_to_bytes(sdp, sdkp->opt_xfer_blocks);
 
+	if (sdkp->opt_xfer_blocks == 0)
+		return false;
+
 	if (sdkp->opt_xfer_blocks > dev_max) {
 		sd_first_printk(KERN_WARNING, sdkp,
 				"Optimal transfer size %u logical blocks " \
-- 
2.21.0

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

* Re: [PATCH] scsi: sd: Quiesce warning if device does not report optimal I/O size
  2019-03-27 16:11   ` [PATCH] scsi: sd: Quiesce warning if device does not report optimal I/O size Martin K. Petersen
@ 2019-03-27 16:46     ` Bart Van Assche
  2019-03-27 18:05       ` Hussam Al-Tayeb
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Van Assche @ 2019-03-27 16:46 UTC (permalink / raw)
  To: Martin K. Petersen, linux-scsi; +Cc: Hussam Al-Tayeb, Randy Dunlap, stable

On Wed, 2019-03-27 at 12:11 -0400, Martin K. Petersen wrote:
> Commit a83da8a4509d ("scsi: sd: Optimal I/O size should be a multiple
> of physical block size") split one conditional into several separate
> statements in an effort to provide more accurate warning messages when
> a device reports a nonsensical value. However, this reorganization
> accidentally dropped the precondition of the reported value being
> larger than zero. This lead to a warning getting emitted on devices
> that do not report an optimal I/O size at all.
> 
> Remain silent if a device does not report an optimal I/O size.
> 
> Fixes: a83da8a4509d ("scsi: sd: Optimal I/O size should be a multiple of physical block size")
> Reported-by: Hussam Al-Tayeb <ht990332@gmx.com>
> Cc: Randy Dunlap <rdunlap@infradead.org>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

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

* Re: [PATCH] scsi: sd: Quiesce warning if device does not report optimal I/O size
  2019-03-27 16:46     ` Bart Van Assche
@ 2019-03-27 18:05       ` Hussam Al-Tayeb
  0 siblings, 0 replies; 6+ messages in thread
From: Hussam Al-Tayeb @ 2019-03-27 18:05 UTC (permalink / raw)
  To: Bart Van Assche, Martin K. Petersen, linux-scsi; +Cc: Randy Dunlap, stable

On Wed, 2019-03-27 at 09:46 -0700, Bart Van Assche wrote:
> On Wed, 2019-03-27 at 12:11 -0400, Martin K. Petersen wrote:
> > Commit a83da8a4509d ("scsi: sd: Optimal I/O size should be a
> > multiple
> > of physical block size") split one conditional into several
> > separate
> > statements in an effort to provide more accurate warning messages
> > when
> > a device reports a nonsensical value. However, this reorganization
> > accidentally dropped the precondition of the reported value being
> > larger than zero. This lead to a warning getting emitted on devices
> > that do not report an optimal I/O size at all.
> >
> > Remain silent if a device does not report an optimal I/O size.
> >
> > Fixes: a83da8a4509d ("scsi: sd: Optimal I/O size should be a
> > multiple of physical block size")
> > Reported-by: Hussam Al-Tayeb <ht990332@gmx.com>
> > Cc: Randy Dunlap <rdunlap@infradead.org>
> > Cc: <stable@vger.kernel.org>
> > Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
>
> Reviewed-by: Bart Van Assche <bvanassche@acm.org>
>
>

I tested two SATA disks and three usb flash drives on two machines. The
warnings are gone.
Thank you very much for the patch.

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

end of thread, other threads:[~2019-03-27 18:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-24 13:07 Debug scsi message in linux 4.19.31 Hussam Al-Tayeb
2019-03-24 16:18 ` Randy Dunlap
2019-03-25  0:04   ` Martin K. Petersen
2019-03-27 16:11   ` [PATCH] scsi: sd: Quiesce warning if device does not report optimal I/O size Martin K. Petersen
2019-03-27 16:46     ` Bart Van Assche
2019-03-27 18:05       ` Hussam Al-Tayeb

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.