[patch] fix TUR method in HP/COMPAQ MSA Device Handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[1] In case of tur_done(), though the result of scsi_normalize_sense()
could be reused, the default ret is fixed to be SCSI_DH_IO, since
tomato is not potato.

[2] in case of hp_sw_tur(), retry is fixed according to HP_SW_RETRIES,
though the sdev asks to try again.

Signed-off-by: Hillf Danton <dhillf@xxxxxxxxx>
---

--- a/drivers/scsi/device_handler/scsi_dh_hp_sw.c	2010-11-01
19:54:12.000000000 +0800
+++ b/drivers/scsi/device_handler/scsi_dh_hp_sw.c	2010-11-17
20:30:34.000000000 +0800
@@ -95,6 +95,8 @@ static int tur_done(struct scsi_device *
 			   "%s: sending tur failed, sense %x/%x/%x\n",
 			   HP_SW_NAME, sshdr.sense_key, sshdr.asc,
 			   sshdr.ascq);
+
+		ret = SCSI_DH_IO;
 		break;
 	}

@@ -113,6 +115,7 @@ static int hp_sw_tur(struct scsi_device
 {
 	struct request *req;
 	int ret;
+	int retry_cnt = 0;

 retry:
 	req = blk_get_request(sdev->request_queue, WRITE, GFP_NOIO);
@@ -145,7 +148,12 @@ retry:
 	}
 	if (ret == SCSI_DH_IMM_RETRY) {
 		blk_put_request(req);
-		goto retry;
+		if (retry_cnt++ < HP_SW_RETRIES)
+			goto retry;
+		else {
+			ret = SCSI_DH_IO;
+			goto out;
+		}
 	}
 	if (ret == SCSI_DH_DEV_OFFLINED) {
 		h->path_state = HP_SW_PATH_PASSIVE;
@@ -153,7 +161,7 @@ retry:
 	}

 	blk_put_request(req);
-
+ out:
 	return ret;
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux