[PATCH 3/3] scsi: st: Tighten the page format heuristics with MODE SELECT

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

 



In the days when SCSI-2 was emerging, some drives did claim SCSI-2
but did not correctly implement it. The st driver first tries MODE
SELECT with the page format bit set to set the block descriptor.
If not successful, the non-page format is tried.

The test only tests the sense code and this triggers also from
illegal parameter in the parameter list. The test is limited to
"old" devices and made more strict to remove false alarms.

Signed-off-by: Kai Mäkisara <Kai.Makisara@xxxxxxxxxxx>
---
 drivers/scsi/st.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 55809f8a62d3..c33c0f2045b7 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -3104,7 +3104,9 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon
 			   cmd_in == MTSETDRVBUFFER ||
 			   cmd_in == SET_DENS_AND_BLK) {
 			if (cmdstatp->sense_hdr.sense_key == ILLEGAL_REQUEST &&
-			    !(STp->use_pf & PF_TESTED)) {
+				cmdstatp->sense_hdr.asc == 0x24 &&
+				(STp->device)->scsi_level <= SCSI_2 &&
+				!(STp->use_pf & PF_TESTED)) {
 				/* Try the other possible state of Page Format if not
 				   already tried */
 				STp->use_pf = (STp->use_pf ^ USE_PF) | PF_TESTED;
-- 
2.43.0





[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