mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 06:14:39 +01:00
scsi: scsi_dh_alua: Check for negative result value
scsi_execute() will now return a negative error if there was an error prior to command submission; evaluate that instead if checking for DRIVER_ERROR. [mkp: build fix] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
This commit is contained in:
1 parent
64aaa3dd09
commit
7e26e3ea02
1 file changed
+4
-4
@@ -563,12 +563,12 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
|
||||
kfree(buff);
|
||||
return SCSI_DH_OK;
|
||||
}
|
||||
if (!scsi_sense_valid(&sense_hdr)) {
|
||||
if (retval < 0 || !scsi_sense_valid(&sense_hdr)) {
|
||||
sdev_printk(KERN_INFO, sdev,
|
||||
"%s: rtpg failed, result %d\n",
|
||||
ALUA_DH_NAME, retval);
|
||||
kfree(buff);
|
||||
if (driver_byte(retval) == DRIVER_ERROR)
|
||||
if (retval < 0)
|
||||
return SCSI_DH_DEV_TEMP_BUSY;
|
||||
if (host_byte(retval) == DID_NO_CONNECT)
|
||||
return SCSI_DH_RES_TEMP_UNAVAIL;
|
||||
@@ -794,11 +794,11 @@ static unsigned alua_stpg(struct scsi_device *sdev, struct alua_port_group *pg)
|
||||
retval = submit_stpg(sdev, pg->group_id, &sense_hdr);
|
||||
|
||||
if (retval) {
|
||||
if (!scsi_sense_valid(&sense_hdr)) {
|
||||
if (retval < 0 || !scsi_sense_valid(&sense_hdr)) {
|
||||
sdev_printk(KERN_INFO, sdev,
|
||||
"%s: stpg failed, result %d",
|
||||
ALUA_DH_NAME, retval);
|
||||
if (driver_byte(retval) == DRIVER_ERROR)
|
||||
if (retval < 0)
|
||||
return SCSI_DH_DEV_TEMP_BUSY;
|
||||
} else {
|
||||
sdev_printk(KERN_INFO, sdev, "%s: stpg failed\n",
|
||||
|
||||
Reference in new issue
Block a user