Jason Yan 1ee2753422 scsi: core: Treat device offline as a failure
When a SCSI device is offline a MODE SENSE command will return a result
with only DID_NO_CONNECT set. In sd_read_write_protect_flag() only the
status byte of the result is checked. Despite a returned status of
DID_NO_CONNECT the command is considered successful and we read
sdkp->write_prot from a buffer containing garbage.

Modify scsi_status_is_good() to treat DID_NO_CONNECT as a failure case.

Link: https://lore.kernel.org/r/20210330114727.234467-1-yanaijie@huawei.com
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-05-10 13:24:03 -04:00
..
2021-04-27 17:05:53 -07:00
2019-07-11 15:14:01 -07:00
2021-04-28 17:22:10 -07:00
2021-04-28 17:22:10 -07:00
2019-07-11 15:14:01 -07:00
2020-03-24 07:57:07 -06:00