scsi: core: Make SCSI Status CONDITION MET equivalent to GOOD
authorDouglas Gilbert <dgilbert@interlog.com>
Wed, 7 Mar 2018 03:19:49 +0000 (22:19 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 14:17:50 +0000 (16:17 +0200)
commit5e315f31faefefdf3757529642884e3f87294d3d
tree42b8494d1fbf6fbb1ed3aa0c062d1d9d1d468ee4
parent3de235c7753b84b18eb806e3cea76560681eda03
scsi: core: Make SCSI Status CONDITION MET equivalent to GOOD

[ Upstream commit 1875ede02ed5e176a18dccbca84abc28d5b3e141 ]

The SCSI PRE-FETCH (10 or 16) command is present both on hard disks
and some SSDs. It is useful when the address of the next block(s) to
be read is known but it is not following the LBA of the current READ
(so read-ahead won't help). It returns two "good" SCSI Status values.
If the requested blocks have fitted (or will most likely fit (when
the IMMED bit is set)) into the disk's cache, it returns CONDITION
MET. If it didn't (or will not) fit then it returns GOOD status.

The goal of this patch is to stop the SCSI subsystem treating the
CONDITION MET SCSI status as an error. The current state makes the
PRE-FETCH command effectively unusable via pass-throughs.

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/scsi_lib.c
include/scsi/scsi.h