linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Retry READ CAPACITY(10)/(16) with good status but no data
@ 2025-07-16 18:48 Ewan D. Milne
  2025-07-16 18:48 ` [PATCH 1/5] scsi: sd: Have scsi-ml retry read_capacity_16 errors Ewan D. Milne
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Ewan D. Milne @ 2025-07-16 18:48 UTC (permalink / raw)
  To: linux-scsi; +Cc: michael.christie, dgilbert

We encountered a SCSI device that responded to the initial READ CAPACITY command
with a good status, but no data was transferred.  This caused a sudden change of
the device capacity to zero when the device was rescanned, for no obvious reason.

This patch series changes read_capacity_10() and read_capacity_16() in sd.c
to retry the command up to 3 times in an attempt to get valid capacity information.
A message is logged if this is ultimately unsuccessful.

There are some predecessor patches, one from a patch in a series by Mike Christie
which changes read_capacity_16() to use the scsi_failures mechanism (which did
not eventually get merged), this makes the changes here much more similar for
both the read_capacity_10 and read_capacity_16() case.  Another patch corrects
a potential use of an uninitialized variable, and a third one removes a check
for -EOVERFLOW that hasn't been needed since commit 72deb455b5ec
("block: remove CONFIG_LBDAF").

The final patch to scsi_debug is allow insertion of the fault to test this change.

Ewan D. Milne (4):
  scsi: sd: Avoid passing potentially uninitialized "sense_valid" to
    read_capacity_error()
  scsi: sd: Remove checks for -EOVERFLOW in sd_read_capacity()
  scsi: sd: Check for and retry in case of READ_CAPCITY(10)/(16)
    returning no data
  scsi: scsi_debug: Add option to suppress returned data but return good
    status

Mike Christie (1):
  scsi: sd: Have scsi-ml retry read_capacity_16 errors

 drivers/scsi/scsi_debug.c |  38 ++++++---
 drivers/scsi/sd.c         | 173 +++++++++++++++++++++++++++-----------
 2 files changed, 151 insertions(+), 60 deletions(-)

-- 
2.47.1


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

end of thread, other threads:[~2025-08-13 17:50 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16 18:48 [PATCH 0/5] Retry READ CAPACITY(10)/(16) with good status but no data Ewan D. Milne
2025-07-16 18:48 ` [PATCH 1/5] scsi: sd: Have scsi-ml retry read_capacity_16 errors Ewan D. Milne
2025-08-13  0:22   ` Bart Van Assche
2025-08-13 17:50   ` Bart Van Assche
2025-07-16 18:48 ` [PATCH 2/5] scsi: sd: Avoid passing potentially uninitialized "sense_valid" to read_capacity_error() Ewan D. Milne
2025-08-13  0:02   ` Bart Van Assche
2025-07-16 18:48 ` [PATCH 3/5] scsi: sd: Remove checks for -EOVERFLOW in sd_read_capacity() Ewan D. Milne
2025-08-13  0:04   ` Bart Van Assche
2025-07-16 18:48 ` [PATCH 4/5] scsi: sd: Check for and retry in case of READ_CAPCITY(10)/(16) returning no data Ewan D. Milne
2025-08-13  0:13   ` Bart Van Assche
2025-07-16 18:48 ` [PATCH 5/5] scsi: scsi_debug: Add option to suppress returned data but return good status Ewan D. Milne
2025-08-13  0:16   ` Bart Van Assche
2025-08-01 20:51 ` [PATCH 0/5] Retry READ CAPACITY(10)/(16) with good status but no data Ewan Milne
2025-08-06  2:22   ` 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;
as well as URLs for NNTP newsgroup(s).